1

When I run ionic cordova run android --livereload I get this error:

net::ERR_CLEARTEXT_NOT_PERMITTED (http://192.168.0.5:8100/)

net::ERR_CLEARTEXT_NOT_PERMITTED error

I'm targeting Android SDK 28. I understand that Android does not allow plain HTTP connections anymore.

Is there a workaround?

2

1 Answer 1

2

Add this attribute to <widget> tag in your config.xml:

<widget ... xmlns:android="http://schemas.android.com/apk/res/android">

Add this code to your config.xml:

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
  <application android:usesCleartextTraffic="true" />
</edit-config>

Don't forget to revert these changes when you build release APK file.

1
  • 4
    try to use https://
    – ogarzonm
    Commented Nov 26, 2019 at 20:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.