create-react-native-app icon indicating copy to clipboard operation
create-react-native-app copied to clipboard

'create-react-native-app' failing on my iOS device

Open GerardVee opened this issue 9 years ago • 18 comments

Description

I followed the "get started" instructions, but I'm unable to open the app on iOS.

Observed Behavior

I ran "npm start," navigated to exp://192.168.0.8:19000 (QR method times out) on my iOS device in the Expo app. There was no terminal output. However, there was this error in the Expo app:

"This experience uses an unsupported version of Expo (SDK 15.0.0). You may need to update Expo." (code undefined).

Environment

  1. Operating system: Windows 10
  2. Phone/emulator/simulator & version: iPhone 6 Plus 10.2 (14C92)

GerardVee avatar Mar 23 '17 23:03 GerardVee

Hi, your project uses the newest Expo SDK, but you may have an older version of Expo Client app on your device which predates that SDK. The latest version in the app store is 1.14.1 at the moment. Can you try updating?

Either way, the error message you encountered is definitely ambiguous and could be clarified. We'll fix this in the next update.

terribleben avatar Mar 24 '17 00:03 terribleben

@GerardVee thanks for the report! As @terribleben noted above, this error message should be improved soon. Please reopen this issue if updating the Expo app on your phone doesn't resolve the error you're seeing.

anp avatar Mar 24 '17 01:03 anp

Hello. After updating the app, I've ran into different issues now. The terminal now states when starting packager:

Starting packager...
***ERROR STARTING PACKAGER***
Starting React Native packager...

and in the Expo app, it errors out, an states the following:

"Error while loading: The request timed out.." (code -1001)

Yet, the device can easily access http://192.168.0.8:19000, and the object is printed out perfectly well. I thank you for your assistance and hope this can be sorted out soon.

GerardVee avatar Mar 24 '17 01:03 GerardVee

Can you paste the full terminal output that includes the error starting the packager?

anp avatar Mar 24 '17 17:03 anp

Sorry for the late reply, the output is:

> react-native-scripts start

Starting packager...
***ERROR STARTING PACKAGER***
Starting React Native packager...

'yarn' is not recognized as an internal or external command,
operable program or batch file.

Packager started!

To view your app with live reloading, point the Expo app to this QR code.
You'll find the QR scanner on the Projects tab of the app.

[QR Code]

Or enter this address in the Expo app's search bar:

  exp://192.168.130.1:19000 (this only works if I go to the IP of my computer: 192.168.0.8:19000)

Your phone will need to be on the same local network as this computer.

For links to install the Expo app, please visit https://expo.io.

Logs from serving your app will appear here. Press Ctrl+C at any time to stop.

GerardVee avatar Mar 25 '17 03:03 GerardVee

Interesting. Do you see the same error if you start the packager with npm start?

anp avatar Mar 25 '17 18:03 anp

Yes, as I was starting the above with npm start.

GerardVee avatar Mar 25 '17 19:03 GerardVee

I have the same issue, but on the iOS simulator. I started a brand new project and there's no error in the console.

Node v7.7.4  
Npm 4.1.2  
[email protected]  
[email protected]  
[email protected]  
watchman 4.7.0  
iPhone 6 simulator - IOS 10.2 (14c89)

on macOS Sierra 10.12.3.

screen shot 2017-03-26 at 2 43 50 pm

juanmnl avatar Mar 26 '17 17:03 juanmnl

+1; I have the same issue as @juanmnl

Edit: I've found a solution that works for me when I try running the iOS simulator. After running npm run ios, I went to the simulator's home page (Shift-CMD-H) and deleted the Expo app. Running npm run ios afterwards reinstalls the Expo app on the simulator.

davidlee1435 avatar Mar 26 '17 23:03 davidlee1435

@GerardVee does your project have a yarn.lock file in the root directory? If the lockfile exists and you have yarn installed, can you try using yarn start to run the packager? If you don't have yarn installed, can you try deleting the yarn.lock file?

anp avatar Mar 27 '17 17:03 anp

@dikaiosune I don't have yarn installed, and a yarn.lock file does not exist.

GerardVee avatar Mar 27 '17 23:03 GerardVee

Thanks for the help everyone! I'm happy to say, I've found a solution: By running

set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.0.8

I've managed to clear up a conflict where in my app would connect to the correct IP (192.168.0.8) but look for some (packager?) info at (192.168.130.1:19001) which it would fail to connect to. Maybe it should be added to the README that after failing to connect, try manually setting the IP? Anyways, thank you lots! (Also, QR works now too!)

GerardVee avatar Mar 28 '17 01:03 GerardVee

Wonderful! Thanks for letting us know!

anp avatar Mar 28 '17 19:03 anp

I ran into the same issue as @GerardVee on my iPhone, even after updating the Expo app. What ended up working was deleting the app entirely and re-downloading from the app store just as suggested above on the simulator.

codybrouwers avatar Aug 20 '17 04:08 codybrouwers

I had same issue, just remove the Expo app by holding alt and tab then everything works fine!

anabaei avatar Oct 04 '17 02:10 anabaei

Hi,

I am running the native app on IOS device (connected on WIFI), connected with my system on LAN. But I am not able to run this app.

vidhyeshp avatar Nov 02 '17 11:11 vidhyeshp

Error : exp://192.168.100.108:19000 Error while loading: The request timed out (code - 10001)

Please do help, its getting little frustrating.

Also guide with the steps for running it properly and share some other techniques.

vidhyeshp avatar Nov 02 '17 11:11 vidhyeshp

@vidhyeshp - try downloading exp and running the project through that -- npm i -g exp and then exp start

brentvatne avatar Nov 15 '17 01:11 brentvatne