Ionic-cli: Failed to load webpage with error: The request timed out.

Created on 13 Oct 2014  ·  29Comments  ·  Source: ionic-team/ionic-cli

Hello Ionic team!
First of all keep up the good work! You are doing an awesome job!

I have a little problem here. When run ionic run ios without any flags my app runs on a device fine, but when I run ionic run ios -l (with livereload) the app starts but with a plank white screen.
I also notice following error in terminal output:
(lldb) 2014-10-13 16:49:36.913 myapp[3830:562396] Failed to load webpage with error: The request timed out.

Could you please point me into right direction?

Running:
ios-deploy -V:
1.2.0

sw_vers -productVersion:
10.9.5

xcodebuild -version
Xcode 6.0.1
Build version 6A317

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

lldb --version
lldb-320.4.124.10

Thanks for your help

Most helpful comment

I got this issue too when I tried to run my app using the -l -c commands:

ionic run ios -l -c

I noticed that this command changes a line in the config.xml file:

// FROM
 <content src="index.html"/>

// TO
 <content src="localhost//192.1.168.0:8000" original-src="index.html"/>

Changing it back to <content src="index.html"/> fixes the issue for me.

All 29 comments

There is an issue that i think is related to this one
https://github.com/driftyco/ionic-cli/issues/127

Have anyone else run into the same issue?

Me the same issue!

me too..

Are you all seeing any errors in the safari web inspector or chrome dev tools when you are running the app?

You may have some JS errors, incorrect resource URIs, or other issues that may be causing this.

Can you first check there are no JS errors from safari web inspector or chrome dev tools?

Let me see... I will report back tomorrow with console log output.

Ok. Here is what I did to replicate the issue:

  • start ionic myApp tabs
  • ionic setup sass
  • ionic platform add ios
  • ionic build ios
  • ionic run ios

After the app is copied and then launched. Right after default cordova splash screen it just displays white page. Below is the terminal output:

Executing commands in '/private/tmp/fruitstrap-lldb-prep-cmds-b8647a1a6f71f6194d3ceae024d7e3f307673097'.
(lldb)     platform select remote-ios --sysroot '/Users/en17682/Library/Developer/Xcode/iOS DeviceSupport/8.1.2 (12B440)/Symbols'
  Platform: remote-ios
 Connected: no
  SDK Path: "/Users/en17682/Library/Developer/Xcode/iOS DeviceSupport/8.1.2 (12B440)/Symbols"
(lldb)     target create "/Users/en17682/dev/projects/WorkTips/myApp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/en17682/dev/projects/WorkTips/myApp/platforms/ios/build/device/myApp.app' (armv7).
(lldb)     script fruitstrap_device_app="/private/var/mobile/Containers/Bundle/Application/7A86D508-0CE6-48E7-9C72-2E9612087B1F/myApp.app"
(lldb)     script fruitstrap_connect_url="connect://127.0.0.1:12345"
(lldb)     command script import "/tmp/fruitstrap_b8647a1a6f71f6194d3ceae024d7e3f307673097.py"
(lldb)     command script add -f fruitstrap_b8647a1a6f71f6194d3ceae024d7e3f307673097.connect_command connect
(lldb)     command script add -s asynchronous -f fruitstrap_b8647a1a6f71f6194d3ceae024d7e3f307673097.run_command run
(lldb)     command script add -s asynchronous -f fruitstrap_b8647a1a6f71f6194d3ceae024d7e3f307673097.autoexit_command autoexit
(lldb)     command script add -s asynchronous -f fruitstrap_b8647a1a6f71f6194d3ceae024d7e3f307673097.safequit_command safequit
(lldb)     connect
Process 0 connected
(lldb)     run
Process 4399 stopped
success
2015-01-06 08:06:32.167 myApp[4399:522726] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/D288A26E-8124-4636-9B31-EE14F5F9CA1C/Library/Cookies/Cookies.binarycookies
(lldb) 2015-01-06 08:06:34.720 myApp[4399:522726] Apache Cordova native platform version 3.7.0 is starting.
(lldb) 2015-01-06 08:06:34.722 myApp[4399:522726] Multi-tasking -> Device: YES, App: YES
(lldb) 2015-01-06 08:06:34.732 myApp[4399:522726] Unlimited access to network resources
(lldb) 2015-01-06 08:06:35.628 myApp[4399:522726] [CDVTimer][keyboard] 0.321031ms
2015-01-06 08:06:35.629 myApp[4399:522726] [CDVTimer][TotalPluginStartup] 0.919998ms
(lldb) 2015-01-06 08:06:41.223 myApp[4399:522726] Resetting plugins due to page load.
(lldb) 2015-01-06 08:07:02.369 myApp[4399:522726] Failed to load webpage with error: The request timed out.
(lldb) 

There is nothing (literally) in console output when remote debugging in Safari and it seems like there is no dom besides html and body empty tags:
screen shot 2015-01-06 at 8 09 40 am

Here is what I am running:

ios-deploy -V
1.3.2

sw_vers -productVersion
10.10.1

xcodebuild -version
Xcode 6.1.1
Build version 6A2008a

 gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

 lldb --version
lldb-320.4.156

 cordova -v
4.1.2

 ionic -v
1.2.14

Deploying to iPhone 6+ MGAL2LL/A, iOS 8.1.2

Thanks

I got this issue too when I tried to run my app using the -l -c commands:

ionic run ios -l -c

I noticed that this command changes a line in the config.xml file:

// FROM
 <content src="index.html"/>

// TO
 <content src="localhost//192.1.168.0:8000" original-src="index.html"/>

Changing it back to <content src="index.html"/> fixes the issue for me.

Hello,
My content tag does not contain localhost....
I have checked the config.xml in www and platforms directory.

Thanks

sometimes you just have to remove all files and add them again:

cordova platform rm [ios/android]
cordova platform add ...

Tried to remove/add platforms. No luck...

with version 1.3.3, I am seeing this work just fine

ionic emulate ios -c -s

However, with livereload turned on

ionic emulate ios -l -c -s

the http requests fail.

Checked the myapp/platforms/ios/trendicity/config.xml and the content tag does get changed. I changed back to the original with no luck.

<content original-src="index.html" src="http://192.168.1.102:8100" />

@keithdmoore - as @pbernasconi pointed out, when you run ionic emulate ios -l - it sets the config.xml content to be the IP address of your ionic server.

However, when it completes ,it should set it back to index.html.

Do you still run into these issues on CLI 1.3.11?

Trying to figure out where to fix this issue, if the Config.xml swap is failing, and how to fix it.

updated to 1.3.11
ran ionic run ios -l
chose first ip from multiple addresses found prompt

Now i am getting different error:
Failed to load webpage with error: Could not connect to the server.

any suggestions?

Thanks

Also, i have removed a line that specifies the live reload ip platformServeAddress": "192.168.56.1" from .ionic/ionic.comfig to get multiple ip addresses available prompt back and tried to use all available IPs but got same error as in my post above.

@jbavari I am using version 1.3.11 of the CLI. I am executing: ionic emulate ios -l
I am trying to make http requests to https://api.instagram.com/v1 and they are failing.
However, when I try: ionic emulate ios
http requests are fine.

I'm in the same boat. Got xcode update today + brew update + npm update -g -- leaving me with a broken stack. No errors in JS console when I run in the browser. If I execute:

ionic build ios --release

and then run from XCode it works, but when I run

ionic run ios --device -l -c

I get the white page of death and Failed to load webpage with error: The request timed out.

I'm guessing it is related to the config.xml source url somehow -- still investigating.

Global versions:

$npm ls --depth=0 -g
/Users/davis/.nvm/v0.10.33/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

UPDATE: I had temporarily turned WiFi off on my phone to debug another issue. I did not realize it required WiFi for serving the resources. This ended up being the issue. Well, here's a summary of how I fixed it:

$ pkill ios-deploy

If you run ps aux | grep ios-deploy you'll probably see a lot of processes stuck in limbo here, so kill them all.

Next, unplug the cable and re-plug it in to reset the state of everything. Make sure WiFi is on and enabled and on the same network as your dev box, then rebuild and deploy -- this worked for me.

I had a similar problem so i upgraded ios-deploy to 1.5.0, and it seemed to fix my issue.
Edit:
Seems that was coincidental, having the same issue again.

yah, me too still having same issue

OS: Mac OS X Yosemite Node Version: v0.12.2 Cordova CLI: 5.0.0 Ionic CLI Version: 1.3.22 Xcode version: Xcode 6.3.1 Build version 6D1002 ios-sim version: 3.1.1 ios-deploy version: 1.5.0 ```

I was running into the same problem. I removed all the plugins & platforms, then added them back in. Then ran "ionic prepare ios" and everything went back to normal.

Hope this helps!

You might also want to try the ionic state reset or ionic state restore - that will wipe out platforms and plugins and restore them from the entries in the package.json file!

I also get this error on iOS when the device changes wifi networks and is no longer on the same network as the development laptop. On Android, it at least pops up a message that it can't reach the IP Address of the development laptop, which is how I finally figured out what was happening.

I had a similar error, it was a WiFi / network issue. I didn't notice that my phone was on Airplane mode.

2015-06-14 00:47:21.088 demo[412:125164] [CDVTimer][TotalPluginStartup] 255.868018ms
(lldb) 2015-06-14 00:47:21.716 demo[412:125164] Resetting plugins due to page load.
(lldb) 2015-06-14 00:47:21.839 demo[412:125164] Failed to load webpage with error: Could not connect to the server.

Sometimes, cordova-plugin-whitelist can solve $http issues also

Muito massa, valeu.

hit this issue when I was working on the train ...
mac was connected to wifi, but device was LTE ... tethered mac to device using hotspot and presto ... working again..

When i return on webview after I playing a video with cordova jwplayer plugin, I have the blank white screen, but the html is there but not displayed.
Cordova jwplayer plugin is another app and when I return on my ionic app, I have get the White Screen Of Death.

For me reboot mac solved issue

If anyone stumbled across this error while using the Quasar Framework, like I did -
You have to remember to use build mode when starting your app on a real ios device, and not dev mode - so instead of quasar dev -m ios --ide use quasar build -m ios --ide.

Was this page helpful?
0 / 5 - 0 ratings