Not able to generate archive when using a Pod file
See original GitHub issueI managed to update to 0.46 rc2 from 0.43 today and everything was looking ok. Building a debug or production release was working. However when I tried to create an archive I ran in the following error:
Undefined symbols for architecture armv7:
"_JSNoBytecodeFileFormatVersion", referenced from:
+[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in libReact.a(RCTJavaScriptLoader.o)
+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o)
"facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from:
+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my project I’m using react-native-maps and since I’m running google maps on iOS I have a podfile similar to this one: https://github.com/airbnb/react-native-maps/blob/master/example/ios/Podfile
It turns out that when I remove the following lines
pod 'React', path: '../../node_modules/react-native', :subspecs => [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
the archive is being built correctly.
I’ve reproduced the error here: https://github.com/compojoom/rn46crash/tree/7c34cf696cf940e21566d73b7e76365fb6aab677
As you can see the podfile just has the pod Yoga and pod React lines.
To run the app, clone the repository and do yarn
. Afterwards open the rn46crash.xcworkspace with XCode, assign a team to the project and build it. You should run in the specified error above.
I’m pasting this issue here and not in the react-native-maps repository as with RN 0.43 - I was able to create an archive with that pod configuration, that’s why I think that there is something wrong in the RN package.
- React Native version: 0.46 rc2
- Platform: ios
- Development Operating System: macOS
- Build tools: Xcode 8.3.3
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:29 (7 by maintainers)
Top GitHub Comments
It seems that adding BatchedBridge subspec resolves the issue. I found it out based on React.podspec file analysis. JSNoBytecodeFileFormatVersion is defined in JSCWrapper.cpp
@tuckg as mentioned above by adding BatchedBridge React subspec in Podfile