Permalink
Browse files

Fix Xcode build error on non-standard setup

Summary:
This change is related to #9677 that can happen when trying to get an Xcode release build, which in turn calls  `react-native-xcode.sh` and if one has a non-standard file setup, ex:

```
ios/
 |_ (iOS related code)
js/
 |
 |_ index.ios.js
     node_modules
     package.json
     (other React Native JS code)
```

The error output in this case is:

```
+ DEST=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app
+ [[ Release = \D\e\b\u\g ]]
+ BUNDLE_FILE=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app/main.jsbundle
+ node /Users/caabernathy/Facebook/OpenSource/Apps/RWMixer/Sample/Build/Mixer-Challenge/js/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/caabernathy/Library/Developer/X
Closes #10262

Differential Revision: D4100083

Pulled By: lacker

fbshipit-source-id: 476f38990d09d5c26c22df77630b1a71b42959e2
  • Loading branch information...
1 parent 1bb323e commit 9d86a1295e77706906d043b8a0ae04c986dd6644 @caabernathy caabernathy committed with Facebook Github Bot Oct 29, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 packager/react-native-xcode.sh
@@ -34,7 +34,7 @@ esac
REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Xcode project file for React Native apps is located in ios/ subfolder
-cd ..
+cd ${REACT_NATIVE_DIR}/../..
# Define NVM_DIR and source the nvm.sh setup script
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"

0 comments on commit 9d86a12

Please sign in to comment.