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

Build stops without errors when building for release #12182

Closed
Naoto-Ida opened this issue Feb 3, 2017 · 6 comments
Closed

Build stops without errors when building for release #12182

Naoto-Ida opened this issue Feb 3, 2017 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Naoto-Ida
Copy link

Naoto-Ida commented Feb 3, 2017

Description

When building for Release scheme on Xcode, the build stops progressing without any warnings or alerts.
Code builds fine on Debug Release.

Before adding my JS it would build for Release scene without issues.
I am using Relay in my code with the required plugins which query a local GraphQL implementation which is available at build time.

Reproduction

  1. react-native init AppName to start with clean React Native proj.
  2. Move JS over to new project.
  3. Run Debug build in Xcode -> Finishes fine.
  4. Go into AppName -> Edit Scheme, change Build Configuration to Release, uncheck Debug executable.
  5. Build output shows following:
// .. all the project libs are done

Run custom shell script 'Bundle React Native code and images'
+ DEST=/Users/Adi/Library/Developer/Xcode/DerivedData/AppName-cykpqtemgicwudggytkcuydyxjyg/Build/Products/Release-iphoneos/AppName.app
+ [[ Release = \D\e\b\u\g ]]
+ BUNDLE_FILE=/Users/Adi/Library/Developer/Xcode/DerivedData/AppName-cykpqtemgicwudggytkcuydyxjyg/Build/Products/Release-iphoneos/AppName.app/main.jsbundle
+ node /Users/Adi/Documents/work/react-native/AppName/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/Adi/Library/Developer/Xcode/DerivedData/AppName-cykpqtemgicwudggytkcuydyxjyg/Build/Products/Release-iphoneos/AppName.app/main.jsbundle --assets-dest /Users/Adi/Library/Developer/Xcode/DerivedData/AppName-cykpqtemgicwudggytkcuydyxjyg/Build/Products/Release-iphoneos/AppName.app
Loading dependency graph, done.
Warning: The transform cache was reset.
[BABEL] Note: The code generator has deoptimised the styling of "/Users/Adi/Documents/work/react-native/AppName/node_modules/lodash/lodash.js" as it exceeds the max of "500KB".
bundle: start
bundle: finish
bundle: Writing bundle output to: /Users/Adi/Library/Developer/Xcode/DerivedData/AppName-cykpqtemgicwudggytkcuydyxjyg/Build/Products/Release-iphoneos/AppName.app/main.jsbundle
bundle: Copying 30 asset files
bundle: Done writing bundle output
bundle: Done copying assets
+ [[ ! -n false ]]

// Here, I think it should output `Touch AppName.app`, but never does...

I'm not sure what this + [[ ! -n false ]] at the end is.
My Terminal is opened with the packager, and the output is as follows:

Looking for JS files in
   /Users/Adi/Documents/work/react-native/AppName 

Loading dependency graph...
React packager ready.

Loading dependency graph, done.

Solution

I would like to know how I can debug this so that I can figure out at what is preventing the progress of the build.

Additional Information

  • React Native version: v0.41.0
  • Platform: iOS
  • Operating System: MacOS
@Naoto-Ida
Copy link
Author

Naoto-Ida commented Feb 3, 2017

So a workaround for this now was to run:
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output iOS/main.jsbundle

Then remove the Bundle React Native code and images script in Xcode.
I'd do a Release build and it would finish successfully.
Nothing in the app seems to be breaking. What could this be? A problem with the bundle script?

@taiki-t
Copy link

taiki-t commented Mar 10, 2017

When building for Release scheme on Xcode, the build stops progressing without any warnings or alerts.
Code builds fine on Debug Release.
I am using Relay in my code with the required plugins

Same here.

I was loading GrapqhQL schema via network in a babel plugin (cf) which runs when react-native packeger runs. This logic was working well in 0.38.0 and as I upgraded to 0.42.0 it became unstable.

In my case, switching from loading the schema via network to loading from a local file made build great again.

I guess, in my case, nodejs process forks when bundling so fetching resources via network doesn't work well in certain situations. macOS asked me several times to allow nodejs to access network and server received same requests several times while bundling so I just thought something could go wrong.

@Naoto-Ida
Copy link
Author

Naoto-Ida commented Mar 14, 2017

@taiki-t So shall we close this?
We seem to have found a workaround, but doesn't seem to be affecting others (but I'm pretty sure GraphQL is being used a lot for serving data to RN apps...).

@taiki-t
Copy link

taiki-t commented Mar 15, 2017

@Naoto-Ida I'm fine with it. I'm happy with my solution. Thank you for considering me.

@Naoto-Ida
Copy link
Author

Ok. Hopefully its not just us thats having issues.

@jifromz
Copy link

jifromz commented Sep 6, 2017

@Naoto-Ida - I tried your solution but I got this error: Script-00DD1BFF1BD5951E006B06BC.sh: (null): bad interpreter: No such file or directory

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

No branches or pull requests

4 participants