微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

升级到 XCode12.5 后不再构建 React Native App

如何解决升级到 XCode12.5 后不再构建 React Native App

我之前在 xcode 11 中构建并在模拟器上运行的 React Native 应用程序。但是,自从升级到 xcode 12.5 后,我收到以下构建错误

Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class>*'

Cannot initialize a parameter of type 'NSArray<Class> *' with an lvalue of type 'NSArray<id<RCTBridgeModule>> *__strong'

Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an lvalue of type 'NSArray<Class> *__strong'

这些错误来自我的项目中通过 cocoapods 的 react-core。

解决方法

更改 RCTCxxBridge.mm 624 行 代码块 Objective-C NSArray *)modules

到 代码块 Objective-C NSArray *)模块

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。