Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis error on react-native IOS Release scheme #20656

Closed
harrydema opened this issue Aug 13, 2018 · 3 comments
Closed

Travis error on react-native IOS Release scheme #20656

harrydema opened this issue Aug 13, 2018 · 3 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@harrydema
Copy link

Environment

React Native Environment Info:
System:
OS: macOS Sierra 10.12.6
CPU: x64 Intel(R) Core(TM) i5-2435M CPU @ 2.40GHz
Memory: 29.20 MB / 8.00 GB
Shell: 5.2 - /bin/zsh
Binaries:
Node: 9.0.0 - ~/.nvm/versions/node/v9.0.0/bin/node
Yarn: 1.9.2 - /usr/local/bin/yarn
npm: 5.5.1 - ~/.nvm/versions/node/v9.0.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
Android SDK:
Build Tools: 23.0.1, 23.0.3, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.2, 27.0.3
API Levels: 23, 25, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.2/9C40b - /usr/bin/xcodebuild
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

When i build ios release scheme locally i get no errors, but when i build on travis the release scheme i get this error under Running script 'Bundle React Native code and images':

File /Users/travis/Library/Developer/Xcode/DerivedData/TestApp-bktrthrvpvtbhdcrrzrzfekixdcy/Build/Products/Release-iphonesimulator/TestApp.app/main.jsbundle does not exist. This must be a bug with

I checked that when i run it locally the main.jsbundle is copied inside this folder but on travis this file is not copied although before building i run: react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle

I am using react-native v0.56

Reproducible Demo

This is my .travis.yml configuration:

- language: objective-c
      sudo: required
      xcode_project: ios/TestApp.xcworkspace
      xcode_scheme: ios/Release
      node_js: false
      env:
        - TEST='IOS RELEASE BUILD'
      before_install:
        - nvm install 9.10.0
      install:
        - brew install yarn
        - yarn install
        - npm install -g react-native-cli
      script:
        - react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle
        - cd ios
        - xcodebuild -workspace TestApp.xcworkspace -scheme Release -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c; exit ${PIPESTATUS[0]}
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Aug 13, 2018
@samjt
Copy link

samjt commented Aug 14, 2018

You can have a look inside the Xcode project build phases. There should be a build phase script called Bundle React Native code and images with something like

export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh

in it. This is the script that's supposed to run on build and bundle the js for you.

Could it be something to do with the path or the node binary path on your Travis CI system?
I notice your travis.yml file says node_js: false, but I don't know enough about Travis to know what this means.

@harrydema
Copy link
Author

@samjt Thank you for the reply.
My Bundle React Native code and images is configured like this:

image

Do you think this problem could be related to the certificates for IOS? As i haven't configured them.

@harrydema
Copy link
Author

Finally, after searching i solved it by adding this line to my travis.yml

nvm alias default v9.10.0

after nvm install 9.10.0

Apparently, the script was using an other version of node and by setting this i forced it to use this node version

@facebook facebook locked as resolved and limited conversation to collaborators Aug 14, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants