Ionic-cli: Livereload on iOS - App gets stuck on white screen with loading spinner

Created on 23 Jun 2019  路  11Comments  路  Source: ionic-team/ionic-cli

Description:
When I execute ionic cordova run ios --device --livereload, the app gets stuck on white screen with a loading indicator as seen in the image below.

IMG_F7FBC67037D0-1

Steps to Reproduce:
ionic start myApp blank --cordova
ionic cordova platform add ios
ionic cordova run ios --device --livereload

My ionic info:

Ionic:

   Ionic CLI                     : 5.1.0 (/Users/emre/.nvm/versions/node/v10.15.3/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.5.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 5 other plugins)

Utility:

   cordova-res : 0.3.0 (update available: 0.4.0)
   native-run  : 0.2.6 

System:

   Android SDK Tools : 26.1.1 (/Users/emre/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.1
   NodeJS            : v10.15.3 (/Users/emre/.nvm/versions/node/v10.15.3/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

Other Information:
I tried ionic cordova run ios --device --livereload --no-native-run, but no luck.
What works for me is build and run the app with Xcode.

triage

Most helpful comment

@dwieeb I've just tested it with --address=0.0.0.0 and I can confirm that it did the trick! I'm closing the issue now. Thanks.

All 11 comments

Things are broken since last Google update on June 16. I get ERR_CLEARTEST_NOT_PERMITTED unable to run on android. This is huge blocker. Unable to proceed with development on both ionic3 or ionic4. Its been 3 days now. thinking of switching to something stable envniornment like react or flutter. Ionic is getting very unstable.

I also have this issue

same here...

@accerpcom That's an entirely different issue and was fixed in our starters here. There's little we can do when Android changes security requirements between major versions. Anything that uses HTTP traffic will encounter that issue, Ionic is not alone here.

I believe the issue people are running into here is that deploying to devices with livereload requires --address=0.0.0.0 for iOS. We need to document this requirement better, but the reasoning is listed in the breaking changes for CLI 5.

I also created an issue in our Webview plugin repo for showing a message when it can't connect: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/381

@accerpcom That's an entirely different issue and was fixed in our starters here. There's little we can do when Android changes security requirements between major versions. Anything that uses HTTP traffic will encounter that issue, Ionic is not alone here.

I believe the issue people are running into here is that deploying to devices with livereload requires --address=0.0.0.0 for iOS. We need to document this requirement better, but the reasoning is listed in the breaking changes for CLI 5.

I also created an issue in our Webview plugin repo for showing a message when it can't connect: ionic-team/cordova-plugin-ionic-webview#381

THANKS!!

@dwieeb I've just tested it with --address=0.0.0.0 and I can confirm that it did the trick! I'm closing the issue now. Thanks.

@dwieeb Sorry bothering, but I noticed that when I close the app it also kills the livereload process. In the past the process would continue running even if you closed the app. Is this new behavior intentional or is it a bug?

It would be really great if it works the way it used to. Imagine you are testing if push notifications are being handled correctly when the app is closed and you want to make quick fixes if there are any issues. But when you close the app you have to rebuild and deploy to make your changes have effect.

@EmreErdogan It was intentional to make it a bit easier for beginners. I can see why that'd be annoying when closing the app is required to test something. You can disable this behavior with the --no-connect flag.

Thanks for your feedback, I'll keep it in mind and see if others have the same opinion.

@dwieeb Thank you for your attention. As far as I can observe, --no-connect flag provides the expected behavior.

Following command worked for me.

ionic cordova run android --livereload --address=0.0.0.0

Was this page helpful?
0 / 5 - 0 ratings