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

[0.46.3] fails to run on device #14912

Closed
ivpusic opened this issue Jul 8, 2017 · 10 comments
Closed

[0.46.3] fails to run on device #14912

ivpusic opened this issue Jul 8, 2017 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ivpusic
Copy link

ivpusic commented Jul 8, 2017

Is this a bug report?

yes

Environment

react-native-cli: 2.0.1
react-native: 0.46.3
node: v8.1.0

Target Platform: iOS

Steps to Reproduce

Build iOS app for release, and try to run it on the actual iOS device.

The app will crash with error:

Error reading bundle /var/containers/Bundle/Application/62A1S7F9-6795-4S7E-93B3-A2F17FC5BFCF/MyApp.app/main.jsbundle

On the simulator, the app runs fine.
After downgrading to 0.45.1 everything worked on the device as well again.

@hramos
Copy link
Contributor

hramos commented Jul 10, 2017

That seems strange. Is this something you can reliably reproduce? For example, does it occur on a plain new project created with 0.46.1?

@ivpusic
Copy link
Author

ivpusic commented Jul 10, 2017

yes, create a plain new project and it fails for me.

@hramos hramos changed the title [0.46] fails to run on device [0.46.1] fails to run on device Jul 10, 2017
@ivpusic
Copy link
Author

ivpusic commented Jul 17, 2017

@hramos any updates here? RN 0.46.3 has the same issue. 0.46.x is basically unusable because of this issue. As I said, it happens on a new project when trying to run it on the device using "Release" config. It should be very simple to reproduce.

@ivpusic ivpusic changed the title [0.46.1] fails to run on device [0.46.3] fails to run on device Jul 17, 2017
@hramos
Copy link
Contributor

hramos commented Jul 17, 2017

I don't have any updates, I haven't seen any PR that addresses this specifically. If one is submitted and merged in, I can look into another point release.

@ivpusic
Copy link
Author

ivpusic commented Jul 19, 2017

Solved it. It seems that packager is trying to figure out node version installed on my system. The problem was that I am using nvm and default nvm node version was v5.7.1, and this was too old to build the app. However in my zsh config, I have nvm use v8.1.0 which is good, but it wasn't picking up v8.1.0 while building the app. The solution was to mark v8.1.0 as nvm default.

@ivpusic ivpusic closed this as completed Jul 19, 2017
@scgough
Copy link

scgough commented Jul 20, 2017

@ivpusic Hi, I too have this problem. When I deploy my app to a device when compiled for Release I see:

Error reading bundle /var/containers/Bundle/Application.../MyApp.app/main.jsbundle

I'm not using nvm - is there an alternative for brew? Node version is v8.2.0

Debug mode works fine (loading the bundle off my laptop)

@ivpusic
Copy link
Author

ivpusic commented Jul 20, 2017

resolving node binary/version is done here https://github.com/facebook/react-native/blob/master/scripts/react-native-xcode.sh#L54. Try to put some debug logs to see what is resolved.

@DaveCole
Copy link

@ivpusic @scgough Did either of you guys find any solution out there? Tried this with the very latest node/npm and still getting the problem.

@dzjin
Copy link

dzjin commented Nov 16, 2017

having this issue as well.

@avz
Copy link

avz commented Nov 22, 2017

if you ever installed nvm, and then deleted it (like me), then you can try rm -r ~/.nvm

https://github.com/facebook/react-native/blob/master/scripts/react-native-xcode.sh#L58

if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
  . "$HOME/.nvm/nvm.sh"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
  . "$(brew --prefix nvm)/nvm.sh"
fi

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 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

7 participants