关于React Native报Cannot initialize a parameter of type ‘NSArray<id<RCTBridgeModule>>错误的解决方案

Posted xiangzhihong8

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于React Native报Cannot initialize a parameter of type ‘NSArray<id<RCTBridgeModule>>错误的解决方案相关的知识,希望对你有一定的参考价值。

最近,在运行一个老RN项目的时候,使用Xcode运行的时候报了如下的代码错误:

Cannot initialize a parameter of type \'NSArray<id<RCTBridgeModule>> *\' 
                with an lvalue of type \'NSArray<Class> *__strong\'
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 rvalue of type \'NSArray<Class> *\'

这是由于升级XCode 12.5之后的问题,在ios/Podfile文件中加入如下的脚本即可。

post_install do 

以上是关于关于React Native报Cannot initialize a parameter of type ‘NSArray<id<RCTBridgeModule>>错误的解决方案的主要内容,如果未能解决你的问题,请参考以下文章