-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Unable to launch react-native(0.29) on iOS physical device(9.3) #8647
Comments
Looking at the code, it seems that you need an https://github.com/facebook/react-native/blob/master/React/Base/RCTBundleURLProvider.m#L29 |
Looking further:
Seems that the packager should create this file. I think this means that you should not have to change anything to run on your device. |
@facebook-github-bot stack-overflow |
Hey @brennanerbz and thanks for posting this! @DanielMSchmidt tells me this issue looks like a question that would be best asked on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO. |
thanks @rogchap - since upgrading to rn 0.29 i can no longer run on a physical device. I'm getting the "Could not connect to development server" error. Have the commands changed that I need to run? Before I was just running npm start. |
Have you updated your AppDelegate? It's completely changed from previous
|
Completely changed? What's different? The only thing I noticed was:
Yes, I've got that. So how do now load js files from a physical device? I use'd to just specify an ipaddress ( |
Have you run '$ react-native upgrade' to upgrade your templates? There are some script files that copy your IP address into a ip.txt file In 0.29.x you do not need to make any changes to run on a physical device.
|
Yes, I've run react-native upgrade. Maybe i missed something in the merge process, but I can't see what. My phone will only load the pre packaged JS files now. What should I look for? How does the phone know which ip address to use? |
https://facebook.github.io/react-native/docs/running-on-device-ios.html Seems that the docs are out-dated. |
@npomfret Did you manage to get this resolved? I have the same issue in that my app no longer connects to the packager and only uses the bundled JS. I have ATS setup with an exception for localhost but I believe that was the default setup when I created my app. Thanks |
Yes, see my comments here #8358 No idea if its the right thing to do, but as far as I can tell the documented solution is wrong. |
@npomfret I dug into this a bit more and found that my problem was related to how the react-native-xcode.sh script creates the IP.txt file when the machine is only on wifi. It uses ipconfig getifaddr en0 which returns blank. I explained the rest here: http://www.stevetrefethen.com/blog/react-native-bundle-loading-failing-on-a-physical-device Basically, you should not have to hard code your IP address in AppDelegate.m it should "just work", if your machine is connected on "en0" that is. |
Right so if you have 2 or more network interfaces, which I do - you need to make sure that the node process binds to the wifi and not the ethernet? How on earth do you do that? I want to use ethernet when its available, not wifi, so I'd rather not bump wifi to the top of the list. I guess that's just not possible now |
Unfortunately, I don't have a great answer other than tweaking react-native-xcode.sh to look at the right device for writing out the IP.txt file. At least I understand what's really happening now. :| |
Only using the react-native-cli starter without changing any app code, I've done everything possible to launch on physical device.
I've followed the react-native docs, changed the IP address to my mac's, provisioned my phone, everything. Please help, as I've spent hours on this.
It seems the react-native0.29 AppDelegate file is different than 0.21. Could this be problem?
Here's the error screenshot:
The text was updated successfully, but these errors were encountered: