RN IOS xproj build failed : main.jsbundle does not exist

Bitrise Build Issue Report template

Foosby.app/main.jsbundle does not exist. This must be a bug with
Last lines of the Xcode’s build log:

Description of the issue

I worked on a react-native app which is compiling and working fine on virtual devices (both IOS/Android).
When I try to build the app on Bitrise, only IOS build keeps failing with this xproj error:

error: File /Users/vagrant/Library/Developer/Xcode/DerivedData/Foosby-fjvqxkfrwpgavkaetbvblmlookgx/Build/Intermediates.noindex/ArchiveIntermediates/Foosby/BuildProductsPath/Release-iphoneos/Foosby.app/main.jsbundle does not exist.

Environment:

on bitrise: Hybrid (Xamarin, Ionic, …) on macOS, includes Visual Studio for Mac, Stable channel
the app: RN 52, react 16, redux 3.6, …
I’m using pods for Firebase , codepush, splash-screen, …

The error occurs during the Xcode Archive & Export for iOS (latest version)
My workflow is: activate ssh key, git clone, yarn install, pod install, certificate installation, xcode archive/export, deploy

Reproducibility

Every IOS build

Local reproduction

Can’t reproduce the error on macosx HightSierra (I’m using react-native run-ios command, I think it’s not the same than bitrise is using).

Build log

Running script ‘Bundle React Native code and images’
the transform cache was reset.
:x: error: File /Users/vagrant/Library/Developer/Xcode/DerivedData/Foosby-fjvqxkfrwpgavkaetbvblmlookgx/Build/Intermediates.noindex/ArchiveIntermediates/Foosby/BuildProductsPath/Release-iphoneos/Foosby.app/main.jsbundle does not exist. This must be a bug with
Last lines of the Xcode’s build log:

  • echo ‘React Native, please report it here: Issues · facebook/react-native · GitHub
    React Native, please report it here: Issues · facebook/react-native · GitHub
  • exit 2
    ** ARCHIVE FAILED **
    The following build commands failed:
    PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/vagrant/Library/Developer/Xcode/DerivedData/Foosby-fjvqxkfrwpgavkaetbvblmlookgx/Build/Intermediates.noindex/ArchiveIntermediates/Foosby/IntermediateBuildFilesPath/Foosby.build/Release-iphoneos/Foosby.build/Script-00DD1BFF1BD5951E006B06BC.sh
    (1 failure)
    You can find the last couple of lines of Xcode’s build log above, but the full log is also available in the raw-xcodebuild-output.log
    The log file is stored in $BITRISE_DEPLOY_DIR, and its full path is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable
    (value: /Users/vagrant/deploy/raw-xcodebuild-output.log)
    Archive failed, error: exit status 65

Hey @wulfy !

Did you set the configuration to Release in the xcode-archive step? Only Release config will run the internal build - post script to bundle the js files in the archive.

Hi @tamaspapik,

The configuration was not set, I tried a new build by setting “configuration name” to “release” but I still having the same error.
Regarding build logs the configuration seems to be ok :

▸ Building Pods/yoga [Release]
▸ Check Dependencies
▸ Compiling YGEnums.cpp
▸ Compiling YGNodePrint.cpp
▸ Compiling yoga-dummy.m
▸ Compiling Yoga.cpp
▸ Compiling YGEnums.cpp
▸ Compiling YGNodePrint.cpp
▸ Compiling yoga-dummy.m
▸ Compiling Yoga.cpp
▸ Building library libyoga.a
▸ Building library libyoga.a
▸ Building Pods/React [Release]
▸ Check Dependencies

Please send here your build’s url. So we can have a closer look. :slight_smile:

Here is the build Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation

I finally manage to build by using a script step to remove a file causing error during debug/staging build (maybe it has side effects during release build)
https://github.com/oblador/react-native-vector-icons/issues/626

Seems to be a pb on a RN lib not bitrise :slight_smile:

Thank you !

Thanks for the info! :slight_smile: Happy Building! :rocket:

Hi!

I’ll be closing this thread, but feel free to ping us any time if you have an issue or if you have any questions! :wink:
Happy Building! :blush: