jwBurnside
jwBurnside

Reputation: 867

Ionic 4: Issue Running Livereload with Environment Configuration Options

I seem to be having an issue using both the configuration flag and the livereload flag when running my Ionic 4 app on an emulator or device. I set my environments up according to the docs here: https://ionicframework.com/docs/cli/commands/cordova-run

and here:

https://ionicframework.com/docs/appflow/quickstart/environment

This cli command will correctly set the environment:

ionic cordova emulate android --configuration=qa

And this will correctly run with livereload:

ionic cordova emulate android --livereload

But when I attempt to combine the flags:

ionic cordova emulate android --livereload --configuration=qa

I get an error: Data path "" should NOT have additional properties(browserTarget).

Here's my ionic info if it helps, any insight would be appreciated:

Ionic:

   Ionic CLI                     : 5.4.2
   Ionic Framework               : @ionic/angular 4.11.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

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

Upvotes: 9

Views: 326

Answers (2)

Mahdi Zarei
Mahdi Zarei

Reputation: 7396

#1: Open android/app/src/main/AndroidManifest.xml.

#2: Add this to your AndroidManifest.xml in the tag (Tag application already exists):

<application android:usesCleartextTraffic="true">

<application android:usesCleartextTraffic="true"> may be needed just for API level > 28.

#3: Run live reload with the host of your PC.

ionic cordova emulate android -l --address=192.168.2.106 --configuration=qa

INSTEAD OF 192.168.2.106 YOU PUT YOUR PC'S ADDRESS.

#4: After run Android Studio with a connected device as usual.

Upvotes: 0

Akash Bhardwaj
Akash Bhardwaj

Reputation: 356

Try installing the latest angular devkit updates:

npm i @angular-devkit/architect@latest @angular-devkit/build-angular@latest @angular-devkit/core@latest @angular-devkit/schematics@latest

Upvotes: 0

Related Questions