Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native App no longer builds after upgrading to XCode12.5

My react native app previously built and ran on a simulator in xcode 11. However since upgrading to xcode 12.5 I get the following build errors

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'

These errors come from react-core which is in my project via cocoapods.

like image 435
MarvoloPoet Avatar asked Apr 29 '21 09:04

MarvoloPoet


People also ask

Can Xcode be used for React Native?

If you are already familiar with mobile development, you may want to use React Native CLI. It requires Xcode or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes.

Is Swift faster than React Native?

Compared to a framework, a Swift app will perform better in most cases. Although it can consume more CPU power when running an application, Swift provides better performance than React Native.

Does Apple allow React Native apps?

All in all, React Native and Swift are both great tools for building iOS apps. To figure out which one suits your project better, you need to take advantage of their peculiarities. React Native supports building apps for iOS, Android, and web from a single code base.


1 Answers

Change RCTCxxBridge.mm 624 line

Code Block Objective-C
NSArray<id<RCTBridgeModule>> *)modules

to

Code Block Objective-C
NSArray<Class> *)modules
like image 126
Patrick Muhire Avatar answered Sep 28 '22 09:09

Patrick Muhire