cli icon indicating copy to clipboard operation
cli copied to clipboard

`react-native run-ios` build failure on XCode 12.5 beta

Open bsk26 opened this issue 5 years ago • 30 comments

Ask your Question

I'm getting a build error while attempting to test our react-native app in XCode 12.5 beta. Apologies if this is inappropriate but it appears to be a real issue.

I'm running "react-native": "0.62.2" (however, it doesn't appear this is fixed in the lastest stable release)

It looks like this exact issue was fixed in https://github.com/facebook/react-native/pull/28362, which is part of 0.63+. This PR indicates it was fixed for Clang 10 but as far as I can tell the clang/llvm version hasn't changed between 12.4 and 12.5. The app builds correctly when using 12.4 command line tools but not 12.5 beta command line tools (configured via XCode preferences).

The build error (with compiler):

** BUILD FAILED **

The following build commands failed:
        CompileC .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTCxxBridge.o /Users/bkraft/Projects/zabo-mobile/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

The stack trace is as follows,

/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:331:34: error: cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class> *'
  (void)[self _initializeModules:RCTGetModuleClasses() withDispatchGroup:prepareBridge lazilyDiscovered:NO];
                                 ^~~~~~~~~~~~~~~~~~~~~
/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:771:82: note: passing argument to parameter 'modules' here
- (NSArray<RCTModuleData *> *)_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules
                                                                                 ^
/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:776:79: error: cannot initialize a parameter of type 'NSArray<Class> *' with an lvalue of type 'NSArray<id<RCTBridgeModule>> *__strong'
  NSArray<RCTModuleData *> *moduleDataById = [self _registerModulesForClasses:modules lazilyDiscovered:lazilyDiscovered];
                                                                              ^~~~~~~
/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:618:76: note: passing argument to parameter 'moduleClasses' here
- (NSArray<RCTModuleData *> *)_registerModulesForClasses:(NSArray<Class> *)moduleClasses
                                                                           ^
/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:827:69: error: cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an lvalue of type 'NSArray<Class> *__strong'
    NSArray<RCTModuleData *> *newModules = [self _initializeModules:modules withDispatchGroup:NULL lazilyDiscovered:YES];
                                                                    ^~~~~~~
/Users/bkraft/Projects/zabo-mobile/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:771:82: note: passing argument to parameter 'modules' here
- (NSArray<RCTModuleData *> *)_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules

bsk26 avatar Feb 09 '21 19:02 bsk26

Try this

  1. Edit Podfile in ios directory like this ↓ =========================== use_flipper!

    ↓
    

use_flipper!({ 'Flipper-Folly' => '2.3.0' })

  1. npm install in project folder
  2. pod install in ios folder

uijunii avatar Feb 25 '21 08:02 uijunii

@bsk26 , did you ever find a solution to this?

afixoftrix avatar Mar 06 '21 23:03 afixoftrix

@bsk26 , did you ever find a solution to this?

I ended up removing flipper since we were hardly using it.

bsk26 avatar Mar 08 '21 22:03 bsk26

@bsk26 ,did you have other way ? I remove flipper , but not working.

best777 avatar Apr 09 '21 07:04 best777

Hi all, is there any solution to this? I'm experiencing the exact same problem

Atoyebs avatar Apr 09 '21 16:04 Atoyebs

@Atoyebs @best777 We weren't actively using Flipper so our solution was to remove it from the app. I'm not sure if the issue has been fixed however the other underlying issues we were facing were resolved in the later versions of ios 14.5 beta.

bsk26 avatar Apr 12 '21 20:04 bsk26

This might be the weirdest thing ever, but it worked for me.

I figured out that creating a project within a folder that contains a space i.e. ~/Documents/My Projects was the problem. When creating a project in a directory that has no spaces i.e. ~/Documents/Projects, you can run the project on both iOS and Android with no errors at all.

gcrozariol avatar Apr 16 '21 16:04 gcrozariol

Seeing the same issue on 14.5... any ideas on how to fix this?

joelvarty avatar Apr 28 '21 00:04 joelvarty

+1

nelsonchen5 avatar Apr 28 '21 02:04 nelsonchen5

+1

Dassine avatar Apr 28 '21 05:04 Dassine

+1

smooney211993 avatar Apr 28 '21 06:04 smooney211993

Hello,

This is now an issue with Xcode 12.5 final, released today... Can't build my app anymore, any workaround ?

YanouHD avatar Apr 28 '21 07:04 YanouHD

+1 XCode Final version 12.5 react-native 0.61.5

honia19 avatar Apr 28 '21 07:04 honia19

This is a Flipper-Folly issue. Commenting useFlipper out from Podfile should work.

https://github.com/facebook/folly/issues/1527 https://github.com/facebook/flipper/issues/2215

another workaround https://github.com/facebook/flipper/issues/2215#issuecomment-827422023

aparedes avatar Apr 28 '21 07:04 aparedes

Since my project has other packages like Firebase that rely on Flipper (I believe) removing it did not work. The workaround I'm using for now is to use XCode 12.4.

joelvarty avatar Apr 28 '21 13:04 joelvarty

Got this issues after upgrade XCode to 12.5. Any workaround for this issue?

daffigusti avatar Apr 28 '21 14:04 daffigusti

same here, react native no longer working after updating to XCode 12.5

teajohnson90 avatar Apr 28 '21 18:04 teajohnson90

build failure on XCode 12.5 , any workaround Cannot initialize a parameter of type 'NSArray<id> *' with an rvalue of type 'NSArray

waqasrasheed86 avatar Apr 28 '21 19:04 waqasrasheed86

Same issue on XCode 12.5 really frustrating. https://github.com/facebook/flipper/issues/2215#issuecomment-827422023 worked as a workaround for me.

3DJakob avatar Apr 28 '21 19:04 3DJakob

I'm facing the same problem, but my RN version is .62 so its not related with flipper

AilsonFreire avatar Apr 29 '21 20:04 AilsonFreire