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

**URL:** https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384
**Category:** Builds
**Created:** [June 12, 2018, 9:53am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384 "2018-06-12T09:53:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![wulfy](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/wulfy/32/1555_2.png) [@wulfy](https://discuss.bitrise.io/u/wulfy)
#### Post date: [June 12, 2018, 9:53am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/1 "2018-06-12T09:53:48Z")

</div>

# 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:

- echo ‘React Native, please report it here: [GitHub · Where software is built](https://github.com/facebook/react-native/issues)’  
React Native, please report it here: [GitHub · Where software is built](https://github.com/facebook/react-native/issues)
- exit 2

## 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.  
> ❌ 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: [GitHub · Where software is built](https://github.com/facebook/react-native/issues)’  
> React Native, please report it here: [GitHub · Where software is built](https://github.com/facebook/react-native/issues)
> - 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

---

<div class="post-metadata">

### Author: ![tamaspapik](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/tamaspapik/32/251_2.png) [@tamaspapik](https://discuss.bitrise.io/u/tamaspapik)
#### Post date: [June 12, 2018, 11:23am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/2 "2018-06-12T11:23:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![wulfy](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/wulfy/32/1555_2.png) [@wulfy](https://discuss.bitrise.io/u/wulfy)
#### Post date: [June 12, 2018, 2:27pm UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/3 "2018-06-12T14:27:38Z")

</div>

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  
…

---

<div class="post-metadata">

### Author: ![tamaspapik](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/tamaspapik/32/251_2.png) [@tamaspapik](https://discuss.bitrise.io/u/tamaspapik)
#### Post date: [June 13, 2018, 9:16am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/4 "2018-06-13T09:16:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wulfy](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/wulfy/32/1555_2.png) [@wulfy](https://discuss.bitrise.io/u/wulfy)
#### Post date: [June 13, 2018, 9:56am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/5 "2018-06-13T09:56:29Z")

</div>

Here is the build [Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation](https://www.bitrise.io/build/03251f9487302e83)

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](https://github.com/oblador/react-native-vector-icons/issues/626)

Seems to be a pb on a RN lib not bitrise 🙂

Thank you !

---

<div class="post-metadata">

### Author: ![tamaspapik](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/tamaspapik/32/251_2.png) [@tamaspapik](https://discuss.bitrise.io/u/tamaspapik)
#### Post date: [June 13, 2018, 12:33pm UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/6 "2018-06-13T12:33:35Z")

</div>

Thanks for the info! 🙂 Happy Building! 🚀

---

<div class="post-metadata">

### Author: ![BirmacherAkos](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/birmacherakos/32/1319_2.png) [@BirmacherAkos](https://discuss.bitrise.io/u/BirmacherAkos)
#### Post date: [June 18, 2018, 6:09am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/7 "2018-06-18T06:09:56Z")

</div>

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! 😉  
Happy Building! 😊

---

<div class="post-metadata">

### Author: ![BirmacherAkos](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/birmacherakos/32/1319_2.png) [@BirmacherAkos](https://discuss.bitrise.io/u/BirmacherAkos)
#### Post date: [June 18, 2018, 6:10am UTC](https://discuss.bitrise.io/t/rn-ios-xproj-build-failed-main-jsbundle-does-not-exist/5384/8 "2018-06-18T06:10:02Z")

</div>


