question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to generate archive when using a Pod file

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:29 (7 by maintainers)

github_iconTop GitHub Comments

50reactions
litmanenPLcommented, Jul 7, 2017

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

19reactions
litmanenPLcommented, Jul 27, 2017

@tuckg as mentioned above by adding BatchedBridge React subspec in Podfile

pod 'React', path: '../../node_modules/react-native', :subspecs => [
   ...,
   'BatchedBridge',
   ...
  ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode can't archive project with cocoapods - Stack Overflow
I ran into the same issue today, and the problem is in use_frameworks !. Remove it and you'll be able to archive your...
Read more >
Archive Fails When Using CocoaPods - PSPDFKit
Q: I am using CocoaPods, and I am getting the following linker issue when archiving my ... Make sure your Podfile points to...
Read more >
Xcode 11.3 - Archive succeeds but … | Apple Developer Forums
I AM able to archive the project using xcodebuild in the terminal and specifying custom paths for the resulting files - but this...
Read more >
Troubleshooting - CocoaPods Guides
<Using the CocoaPods Project · Check if the pod header files are correctly symlinked in Pods/Headers and you are not overriding the HEADER_SEARCH_PATHS...
Read more >
Xcode 12 Build Issues (iOS 14 Simulators, Archive) | Medium
Step 2: You should do is delete VALID_ARCHS from your project altogether (Main Project & Pod Project Both), and make sure Architectures (ARCHS) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found