react-native: Undefined symbols for architecture i386
I’m building an app on Mac OS X El Capitan (10.11.5), running Xcode 7.3.1 (7D1014), with React 15.2.1 and React Native 0.29.1. My app runs fine in the iOS Simulator for all but the iPad 2, iPhone 4s, and iPhone 5. On these devices, I get the following errors:
ld: warning: ignoring file /Users/scott/Library/Developer/Xcode/DerivedData/MyApp-gnysvlrqxawwzdagzfxrnkbhnbzh/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp, file was built for x86_64 which is not the architecture being linked (i386): /Users/scott/Library/Developer/Xcode/DerivedData/MyApp-gnysvlrqxawwzdagzfxrnkbhnbzh/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
Undefined symbols for architecture i386:
"std::terminate()", referenced from:
___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
"operator delete[](void*)", referenced from:
-[RCTJSCExecutor dealloc] in libReact.a(RCTJSCExecutor.o)
executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o)
readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) in libReact.a(RCTJSCExecutor.o)
RandomAccessBundleData::~RandomAccessBundleData() in libReact.a(RCTJSCExecutor.o)
"operator new[](unsigned long)", referenced from:
executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o)
readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) in libReact.a(RCTJSCExecutor.o)
"___cxa_begin_catch", referenced from:
___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
"___gxx_personality_v0", referenced from:
-[RCTJavaScriptContext initWithJSContext:onThread:] in libReact.a(RCTJSCExecutor.o)
-[RCTJavaScriptContext init] in libReact.a(RCTJSCExecutor.o)
-[RCTJavaScriptContext invalidate] in libReact.a(RCTJSCExecutor.o)
RCTNSErrorFromJSError(RCTJSCWrapper*, OpaqueJSContext const*, OpaqueJSValue const*) in libReact.a(RCTJSCExecutor.o)
+[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o)
-[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o)
-[RCTJSCExecutor initWithUseCustomJSCLibrary:] in libReact.a(RCTJSCExecutor.o)
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas what might be going wrong?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 17 (3 by maintainers)
I just fixed this by deleting and creating my scheme in Xcode (credit goes to this SO post). Here’s what I did in Xcode 7.3.1:
Click your project on the left side, select your Target, under Dead Code Stripping > Release, select “No”
Any updates on this?
Yes
-lc++
is added toOther linker flags
. Also, I addedlibz.tbd
toLink Binary With Libraries
but it didn’t make a difference.@stenrap I don’t know much about Xcode project schemes. If I delete the Scheme, I wouldn’t know what you create in step 4. Can you inform? Thanks!
see if
-lc++
is added toOther linker flags
for your test target.Have you tried clearing DerivedData?
I have the same issue with MyProjectTests, but with all IOS simulators , https://github.com/facebook/react-native/issues/8890