我无法使用 Xcode 12.5 构建使用 Xcode 11 正确构建的 React Native 项目。
我不能再使用 Xcode 11,因为只有更新的 Xcode 版本才带有必要的 API 来发布/上传到 TestFlight 和应用程序商店。
现在我收到三个构建错误:
Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *'
Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *'
Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *'
我还注意到部署目标从 10 和 9 自动升级:
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.1;
添加了一些与 Clang 相关的新属性:
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
如何配置项目以使用 Xcode 12.5 部署此应用程序?
$ react-native info info Fetching system and libraries information... System: OS: macOS 11.3 CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz Memory: 256.45 MB / 8.00 GB Shell: 3.2.57 - /bin/bash 二进制文件:节点:10.16.0 - /usr/local/bin/node 纱线:1.21.1 - ~/npm-global/bin/yarn npm:6.9.0 - /usr/local/ bin/npm Watchman:4.9.0 - /usr/local/bin/watchman SDK:iOS SDK:平台:iOS 14.5、DriverKit 20.4、macOS 11.3、tvOS 14.5、watchOS 7.4 IDE:Xcode:12.5/12E262 - /usr/bin /xcodebuild npmPackages: react: ^16.11.0 => 16.12.0 react-native: 0.61.4 => 0.61.4 npmGlobalPackages: react-native-cli: 2.0.1