mjohnston / react-native-webpack-server

Build React Native apps with Webpack
MIT License
933 stars 84 forks source link

XCode build failure using setup from readme #140

Open jeanblanchard opened 8 years ago

jeanblanchard commented 8 years ago

Using the install and setup steps from the readme, I get an error when building from xcode:

react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output /Users/jblanchard/Library/Developer/Xcode/DerivedData/roombookingui-ejmsxsvpbrmzpueyoekrkqlfcojv/Build/Products/Debug-iphonesimulator/roombookingui.app/main.jsbundle --assets-dest /Users/jblanchard/Library/Developer/Xcode/DerivedData/roombookingui-ejmsxsvpbrmzpueyoekrkqlfcojv/Build/Products/Debug-iphonesimulator/roombookingui.app
bundle: Created ReactPackager
uncaught error Error: NotFoundError: Cannot find entry file index.ios.js

Looking at the example projects, its appears to be because the PBXShellScriptBuildPhase (i.e. react-native-xcode.sh) should not be called in project.pbxproj

And indeed if I run react-native upgrade in the BabelES6 example project, it adds the step in question to the build, and causes it to fail.

So, how are the ios and android folders generated in the example projects? Is there a step missing in the setup instructions ?

feifanzhou commented 8 years ago

Also seeing this issue, quick fix is to comment/remove the Build Phase (click the project at the top of the Xcode navigator, go to the Build Phases tab, and remove the last one)

(Just in case you want to undo, the command is ../node_modules/react-native/packager/react-native-xcode.sh)

ghost commented 8 years ago

I was getting thrown off for a while today with a similar issue trying to upgrade to Forever 21 by a Watchman issue. Aside from removing the erroneous bundling task from Xcode, as suggested, the above error was resolved for me after I reinstalled Watchman with brew uninstall watchman && brew install --HEAD watchman. YMMV