为了使用 iOS 13 SDK 构建我的 react 原生应用程序,我将 xcode 从 10.3 升级到 11.5,那么为什么我的应用程序不起作用呢?



我和我的团队在工作中,我们收到了来自 App Store 团队的消息,其中包含:

Dear Developer,
We identified one or more issues with a recent delivery for your app, "XXXX" version. 
Your delivery was successful, but you may wish to correct the following issues in your next delivery:ITMS-90725: SDK Version Issue - This app update was built with the iOS 12.4 SDK. 
As of June 30, 2020, updates to apps for iPhone or iPad must be built with the iOS 13 SDK or later.
ITMS-90809: Deprecated API Usage - App updates that use UIWebView will no longer be accepted as of December 2020.Instead, use WKWebView for improved security and reliability.
  • 所以我从ITMS-90725开始,这似乎是我们应该修复的第一个。要在iOS 13 SDK中构建react 原生应用程序,我需要将 xcode 版本从 10.3 升级到 11.5

  • 我做了升级的事情,然后在iOS 13 SDK中构建了应用程序,构建成功,但应用程序无法运行,经过一些调试,我发现了这个问题:

<小时 />
Thread 1: Exception: "App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window.
Use the statusBarManager object on the window scene instead."

  • 然后我尝试了很多搜索,直到现在我都找不到任何解决方案。

运行命令后的配置react-native info=>

System:
OS: macOS 10.15.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 273.72 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6200805
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0 
react-native: 0.61.5 => 0.61.5

我们使用的依赖项=>

"dependencies": {
"@microsoft/applicationinsights-react-native": "^2.1.0",
"@microsoft/applicationinsights-web": "^2.3.1",
"@react-native-community/async-storage": "1.6.2",
"@react-native-community/datetimepicker": "2.1.0",
"@react-native-community/netinfo": "3.2.1",
"@react-native-community/viewpager": "^1.1.7",
"@react-navigation/core": "3.5.1",
"@react-navigation/native": "3.6.2",
"appcenter": "^3.0.3",
"appcenter-analytics": "^3.0.3",
"appcenter-crashes": "^3.0.3",
"deepmerge": "^4.0.0",
"geolib": "^3.0.4",
"i18n-js": "^3.3.0",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"moment-range": "^4.0.2",
"moment-timezone": "^0.5.26",
"normalize-strings": "^1.1.0",
"prop-types": "^15.7.2",
"qs": "^6.9.0",
"ramda": "^0.26.1",
"react": "16.9.0",
"react-is": "^16.10.1",
"react-native": "0.61.5",
"react-native-adjust": "4.18.1",
"react-native-awesome-card-io": "^0.8.2",
"react-native-calendars": "https://github.com/freework-gmbh/react-native-calendars.git#20dc9a8",
"react-native-config": "0.11.7",
"react-native-country-picker-modal": "0.8.0",
"react-native-deep-link": "0.2.9",
"react-native-device-info": "3.1.4",
"react-native-email-link": "1.4.0",
"react-native-gesture-handler": "^1.4.1",
"react-native-idfa": "^4.1.0",
"react-native-indicators": "0.13.0",
"react-native-iphone-x-helper": "1.2.1",
"react-native-joi": "0.0.5",
"react-native-keyboard-aware-scroll-view": "0.9.1",
"react-native-localize": "^1.4.0",
"react-native-masked-text": "1.13.0",
"react-native-material-dropdown": "https://github.com/Squirel-SI/react-native-material-dropdown.git",
"react-native-phone-input": "0.2.4",
"react-native-reanimated": "1.3.0",
"react-native-render-html": "4.1.2",
"react-native-screen-brightness": "2.0.0-alpha",
"react-native-screens": "^2.0.0-alpha.3",
"react-native-sensitive-info": "^5.5.3",
"react-native-webview": "7.4.1",
"react-navigation": "4.0.10",
"react-navigation-drawer": "2.2.2",
"react-navigation-redux-helpers": "4.0.0",
"react-navigation-stack": "1.9.3",
"react-navigation-tabs": "2.5.5",
"react-redux": "7.0.2",
"recompose": "^0.30.0",
"redux": "^4.0.4",
"redux-saga": "^1.1.1",
"rn-viewpager": "https://github.com/Squirel-SI/React-Native-ViewPager.git",
"striptags": "^3.1.1",
"styled-components": "^4.4.0",
"url-join": "^4.0.1"
},

你们谁能帮我解决这个问题?请!

我找到了解决上述崩溃的方法,问题与IOS状态栏功能有关。

之前,使用 sdk IOS 10.3,我们有这个代码块 控制了AppDelegate.m项目文件中状态栏的外观:

[application setStatusBarHidden:NO];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = [UIColor colorWithRed:8.0/255.0f green:128.0/255.0f blue:166.0/255.0f alpha:1.0];
}

因此,通过删除这些行,该应用程序可以完美运行,除了一件事,状态栏失去了我们想要用于此的颜色。我仍在寻找一个好的解决方案来使用 sdk IOS 13.5 控制 IOS 端状态栏的样式。

相关内容

  • 没有找到相关文章

最新更新