react-native: [iOS] Build Fails when Scheme is set to Release

Just changed the Scheme to Release based o the hint about disabling debug menu: https://facebook.github.io/react-native/docs/debugging.html#debugging-react-native-apps

I get this error now with 0.14.2

Developer/Library/Frameworks'
Undefined symbols for architecture arm64:
  "_RCTSetLogFunction", referenced from:
      -[rnpocTests testRendersWelcomeScreen] in rnpocTests.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)```

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I just hit this issue as well. After disabling dead code stripping (per @hasen6’s comment), the build completed successfully.

Here’s how I disabled it:

  1. Opened XCode and pressed cmd + 1
  2. Clicked on my project in the left panel, my target in the middle panel
  3. Clicked on “Build Settings”
  4. In the “Linking” section, under the “Dead Code Stripping” section, changed the setting for “Release” from “Yes” to “No”

This is just a workaround, but hopefully helpful if you’re also hitting this.

HI, I have the same problem but -it says architecture i386 instead of arm64 -it only happens when i choose iphone 5/4s simulators; other version such as 5s/6/6s don’t have the problem

I tried the dead code stripping and add libReact.a to TESTS, both of them are not working for me.

Have anyone had the same problem?

I have the same issue. No errors with Debug, 2 errors in Release schema Undefined symbols for architecture armv7: "_RCTSetLogFunction", referenced from: -[myrule1Tests testRendersWelcomeScreen] in myrule1Tests.o ld: symbol(s) not found for architecture armv7

Yes I have same problem

  • I create objective-c custom framework and import to my project it’s working 100% for debug mode.
  • But whenever I build for release mode and import to my project it is getting error only for iPhone 4s, iPhone 5 and iPad 2 otherwise it’s working for all.
  • Error like this - Undefined symbols for i386 or x86_64.

Please anyone tell me solution…