react-native: react-native-xcode error after upgrading to 0.46

Environment

react-native:

⇒  react-native -v
react-native-cli: 2.0.1
react-native: 0.46.1

node: v8.1.3 npm: 5.0.3 yarn: 0.27.5

  1. Target Platform: iOS
  2. Development Operating System: macOS Sierra
  3. Build tools: Xcode 8.3.3

Steps to Reproduce

  1. Project with RN 0.44
  2. yarn upgrade --latest
  3. react-native-git-upgrade
  4. react-native run-ios

Expected Behavior

Expect my project to build

Actual Behavior

After upgrading to RN 0.46 from 0.44 i tried to run the project by using react-native run-ios but it fails building it with this error:

react-native run-ios produce this error:

    export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO
    export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode
    export XCODE_PRODUCT_BUILD_VERSION=8E3004b
    export XCODE_VERSION_ACTUAL=0833
    export XCODE_VERSION_MAJOR=0800
    export XCODE_VERSION_MINOR=0830
    export XPCSERVICES_FOLDER_PATH=myApp.app/XPCServices
    export YACC=yacc
    export arch=x86_64
    export variant=normal
    /bin/sh -c /Users/vood/dev/myApp/ios/build/Build/Intermediates/myApp.build/Debug-iphonesimulator/myApp.build/Script-00DD1BFF1BD5951E006B06BC.sh

/Users/vood/dev/myApp/ios/build/Build/Intermediates/myApp.build/Debug-iphonesimulator/myApp.build/Script-00DD1BFF1BD5951E006B06BC.sh: line 3: ../node_modules/react-native/packager/react-native-xcode.sh: No such file or directory



** BUILD FAILED **


The following build commands failed:

	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images build/Build/Intermediates/myApp.build/Debug-iphonesimulator/myApp.build/Script-00DD1BFF1BD5951E006B06BC.sh

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

change ../node_modules/react-native/packager/react-native-xcode.sh to ../node_modules/react-native/scripts/react-native-xcode.sh

@sandinosaso sorry I should have been clearer.

Open in Xcode -> Select your Project -> “Build Phases” tab -> “Bundle React Native code and images”

Then change the above paths.

@Tom29 in case you’ve initiated project with react-native 0.46 and then downgraded dependency to 0.45 - you need to change in your ios/${Project}.xcodeproj/project.pbxproj next lines:

  • from export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh
  • to export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh

I am using 0.50 and its moved to export NODE_BINARY=node …/node_modules/react-native/scripts/react-native-xcode.sh

Is there ever gonna be stability in RN?

same thing for me. the Bundle React Native code and images phase vanished. so the above almost worked for me. But I’m on RN 0.47.2 so export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh use script instead of packager to avoid script error. hope this helped.

Thank you @AndrewJack suggestion of moving the react-native-xcode.sh script to a different folder worked, however I am wondering, why is this required? I mean is this just a workaround right? Thank you

@AndrewJack So pressed for time right now and your solution has saved me twice in the last couple months. Thank you!