iOS main.jsbundle does not exists – Bundle React Native code and images

See original GitHub issue

Hello!

I have updated an app from react-native@0.55.4 to react-native@0.59.9 and I’m having problems with the iOS build step Bundle React Native code and images. The problem is that when the build gets on this step on the CI machine, fails automatically throwing the following error:

'error: File /Users/travis/Library/Developer/Xcode/DerivedData/app-arslyffdnfsjkgdxahmrdswzporu/Build/Intermediates.noindex/ArchiveIntermediates/app/BuildProductsPath/Release-iphoneos/appName.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues'

What bothers me is the thing that I can make a bundle on the CI machine using the react-native bundle command without any problems or issues So I can safely assume that there’s no problem with the bundle creation.

Screen Shot 2019-07-06 at 09 39 58

From what I’ve read at #18472, I tried the proposed solutions such as ensuring that the version of node it’s specified by nvm as default, tried to use another version of Xcode, tried to use a newer version of Node. Nothing fixed the problem. Also I’ve tried to debug the issue and seems that this command it’s not being executed. The thing is that this script itself doesn’t give any output of what happened on success or fail.

Screen Shot 2019-07-06 at 09 29 49

https://github.com/facebook/react-native/blob/c20070f10458d48d6ac1eaac49e681e932bfb9fd/scripts/react-native-xcode.sh#L121-L129

This is the error log:

Screen Shot 2019-07-06 at 09 26 33

React Native Environment

I’m running the builds on a Travis CI machine and before the bump to 0.59.9 this never happened.

info 
  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (2) x64 Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
      Memory: 1.94 GB / 4.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
      Yarn: 1.16.0 - ~/.yarn/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 

Steps To Reproduce

  1. Run the following command:
xcodebuild -scheme projectName -project ./ios/projectName.xcodeproj -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/travis/Library/Developer/Xcode/Archives/2019-07-06/AppName\ 2019-07-06\ 07.16.44.xcarchive -UseModernBuildSystem=NO archive | tee /Users/travis/Library/Logs/gym/AppName-projectName.log | xcpretty

Describe what you expected to happen:

I expect that the main.jsbundle file is created successfully through the step of Bundle React Native code and images as it does if I do it manually using the react-native bundle command.

Thanks 🙏

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:34 (7 by maintainers)

github_iconTop GitHub Comments

120reactions
carloscuestacommented, Jul 7, 2019

After debugging out the issue, I found the problem, leaving it here just in case could help anyone:

On Xcode at the Bundle React Native code and images Build Phase I’ve set up the NODE_BINARY to the result of which node.

Then the CI finds always the correct binary regardless the node install method.

export NODE_BINARY=$(which node)
Screen Shot 2019-07-08 at 00 36 56
26reactions
rishisingh-devcommented, Jul 13, 2020

Upgraded react native version to 0.63.0 and build failed. Tried all solutions here but no luck yet. 😭

Read more comments on GitHub >

github_iconTop Results From Across the Web

main.jsbundle does not exist. this must be a bug with + echo ...
this will generate a "main.jsbundle" file in iOS folder ... Project > Build Phases > Bundle React Native code and images. There was...
Read more >
main.jsbundle does not exist. This must be a bug with #29356
"build:ios": "react-native bundle --entry-file='index.ios.js' --bundle-output='./ios/NewApp/main.jsbundle' --dev=false --platform='ios' ...
Read more >
main.jsbundle does not exist [fixed] | by Onexlab - Medium
Make sure you're running a packager server or have include a .jsbundle file in your application bundle. It will show you the prompt...
Read more >
React Native build failed - "Error: main.jsbundle does not exist"
TL; DR * Check if CircleCI have change the image you are building with, if they have, your nodejs version or other parts...
Read more >
Build Command Failed Using FastLan… - Apple Developer
app/main.jsbundle does not exist. Additionally, I was informed that the following build commands failed: PhaseScriptExecution Bundle\ React\ Native\ code ...
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