# ERR\_CLEARTEXT\_NOT\_PERMITTED in debug app on Android

**URL:** <https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101>\
**Category:** ionic-v3\
**Created:** [May 17, 2019, 2:15am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101 "2019-05-17T02:15:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnCressman](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@JohnCressman](https://forum.ionicframework.com/u/JohnCressman)\
**Post date:** [May 17, 2019, 2:15am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/1 "2019-05-17T02:15:56Z")

</div>

I’m still working on getting my movie database application working and I found out how to remotely view the error messages on the app in Chrome, so now I see as I type and the server is called, I get the following error message:

```auto
GET http://www.omdbapi.com/?s=Bat&type=&apikey=999999 net::ERR_CLEARTEXT_NOT_PERMITTED

```

It appears that this should be able to be solved by putting a line in the Android Manifest file, which I should be able to do by adding the following line to the config.xml

```auto
android:usesCleartextTraffic="true"

```

Which I did (see below)

```auto
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
            <application android:usesCleartextTraffic="true" />
        </edit-config>

```

I’m still getting the error message however, even after re-deploying and reconnecting the debugging.

Anyone have any experience on how to solve this issue on Android?

---

<div class="post-metadata">

**Author:** ![TomCosta](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tomcosta/32/149715_2.png) [@TomCosta](https://forum.ionicframework.com/u/TomCosta)\
**Post date:** [May 23, 2019, 5:54pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/2 "2019-05-23T17:54:29Z")

</div>

**[SOLUTION]** On top of your config.xml file add this code:

```auto
    <access origin="*" />
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:usesCleartextTraffic="true" />
    </edit-config>
    <allow-navigation href="*" />

```

It works for me.

---

<div class="post-metadata">

**Author:** ![pabloo87](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/pabloo87/32/99604_2.png) [@pabloo87](https://forum.ionicframework.com/u/pabloo87)\
**Post date:** [June 1, 2019, 9:38pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/3 "2019-06-01T21:38:45Z")

</div>

It gives me this error: :app:mergeDebugResources. Anyone got the same problem?

---

<div class="post-metadata">

**Author:** ![TomCosta](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tomcosta/32/149715_2.png) [@TomCosta](https://forum.ionicframework.com/u/TomCosta)\
**Post date:** [June 4, 2019, 2:13pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/4 "2019-06-04T14:13:18Z")

</div>

Hi @pabloo87 !

In that case, I suggest you to do as follows:  
`ionic cordova platform remove cordova`

After this do that:  
`ionic cordova platform add cordova@7`

And try again:  
`ionic cordova run android --livereload`

Please, let me know if it helps you!

---

<div class="post-metadata">

**Author:** ![JohnCressman](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@JohnCressman](https://forum.ionicframework.com/u/JohnCressman)\
**Post date:** [June 4, 2019, 6:00pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/5 "2019-06-04T18:00:01Z")

</div>

That seems to totally screw things up.

Unable to load PlatfromApi from platform. Error [Err\_UNHANDLED\_ERROR]" Unhandled error. (Does not appear to implement platform Api.)  
Unhandled error. (The platform “cordova” does not appear to be a valid cordova platform. It is missing API.js. cordova not supported.)

And now I can re-install it.

Oh joy.

---

<div class="post-metadata">

**Author:** ![pabloo87](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/pabloo87/32/99604_2.png) [@pabloo87](https://forum.ionicframework.com/u/pabloo87)\
**Post date:** [June 5, 2019, 5:46pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/6 "2019-06-05T17:46:58Z")

</div>

Thanks for the suggestion but i solved the problem in a different way.

> [@Livereload ERR\_CLEARTEXT\_NOT\_PERMITTED](https://forum.ionicframework.com/t/livereload-err-cleartext-not-permitted/163487/):
>
> When using: ionic cordova run android --livereload I get the following error on my device: [Zrzut%20ekranu%20z%202019-05-09%2011-19-37] so the problem is the ERR\_CLEARTEXT\_NOT\_PERMITTED . I have try it to add to my manifest but unfortunately the manifest is overwritten after ionic cordova run android --livereload

---

<div class="post-metadata">

**Author:** ![JohnCressman](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@JohnCressman](https://forum.ionicframework.com/u/JohnCressman)\
**Post date:** [June 5, 2019, 7:03pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/7 "2019-06-05T19:03:47Z")

</div>

Can you tell me how you solved the problem?

---

<div class="post-metadata">

**Author:** ![pabloo87](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/pabloo87/32/99604_2.png) [@pabloo87](https://forum.ionicframework.com/u/pabloo87)\
**Post date:** [June 5, 2019, 7:39pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/8 "2019-06-05T19:39:45Z")

</div>

Yes, i modified network\_security\_config.xml file changing `<domain>localhost</domain>` to `<domain>served_ip</domain>`, after the last ionic update the served ip it’s “localhost” so there is no need to change the file anymore. I recommend you to update the app

---

<div class="post-metadata">

**Author:** ![TomCosta](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tomcosta/32/149715_2.png) [@TomCosta](https://forum.ionicframework.com/u/TomCosta)\
**Post date:** [June 6, 2019, 11:39am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/9 "2019-06-06T11:39:56Z")

</div>

The purpose is just to let you to reinstall the Cordova version 7.

---

<div class="post-metadata">

**Author:** ![NurGuz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nurguz/32/111671_2.png) [@NurGuz](https://forum.ionicframework.com/u/NurGuz)\
**Post date:** [June 17, 2019, 7:43am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/10 "2019-06-17T07:43:52Z")

</div>

Doesn’t work for me, any idea?

---

<div class="post-metadata">

**Author:** ![KokilaBawankar](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@KokilaBawankar](https://forum.ionicframework.com/u/KokilaBawankar)\
**Post date:** [June 19, 2019, 4:49am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/11 "2019-06-19T04:49:05Z")

</div>

Use the below command to livereload  
ionic cordova run android --device -l --ssl --debug

---

<div class="post-metadata">

**Author:** ![NurGuz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nurguz/32/111671_2.png) [@NurGuz](https://forum.ionicframework.com/u/NurGuz)\
**Post date:** [June 19, 2019, 8:53am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/12 "2019-06-19T08:53:18Z")

</div>

I had updated IONIC CLI (v5) and Android platforms-tools to v28.

```auto
ionic cordova run android -l

```

After, you need update your config.xml

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

```

---

<div class="post-metadata">

**Author:** ![bundayy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bundayy/32/127402_2.png) [@bundayy](https://forum.ionicframework.com/u/bundayy)\
**Post date:** [June 21, 2019, 6:00pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/13 "2019-06-21T18:00:08Z")

</div>

yh, i got the same issue after adding it

---

<div class="post-metadata">

**Author:** ![bundayy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bundayy/32/127402_2.png) [@bundayy](https://forum.ionicframework.com/u/bundayy)\
**Post date:** [June 21, 2019, 6:14pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/15 "2019-06-21T18:14:02Z")

</div>

Adding `<allow-navigation href="*" />` in my `config.xml` solves the issue

---

<div class="post-metadata">

**Author:** ![sukeshk](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sukeshk](https://forum.ionicframework.com/u/sukeshk)\
**Post date:** [August 1, 2019, 6:08am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/16 "2019-08-01T06:08:17Z")

</div>

I had the same error “Err-cleartext-not-permitted-in” coming in debug console.  
I resolved it by adding **IP address** of the API url in  
**network\_security\_config.xml file changing** `<domain>localhost</domain>`

---

<div class="post-metadata">

**Author:** ![salomon022](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@salomon022](https://forum.ionicframework.com/u/salomon022)\
**Post date:** [August 1, 2019, 6:14am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/17 "2019-08-01T06:14:39Z")

</div>

goto project/resources/android/xml/network\_security\_config.xml

```auto
<domain-config cleartextTrafficPermitted="true">

        <domain includeSubdomains="true">localhost</domain>
        <domain includeSubdomains="true">http://www.omdbapi.com</domain>
 <domain includeSubdomains="true">http://www.yourdomain.in</domain>
    <domain includeSubdomains="true">http://serveripaddress</domain>
    </domain-config>

```

---

<div class="post-metadata">

**Author:** ![jayvpagnis](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jayvpagnis](https://forum.ionicframework.com/u/jayvpagnis)\
**Post date:** [August 19, 2019, 1:25pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/18 "2019-08-19T13:25:41Z")

</div>

For me this worked! Apparently this issue comes on the latest phones.

---

<div class="post-metadata">

**Author:** ![rvalenzuela](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rvalenzuela/32/128098_2.png) [@rvalenzuela](https://forum.ionicframework.com/u/rvalenzuela)\
**Post date:** [August 22, 2019, 9:37pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/19 "2019-08-22T21:37:00Z")

</div>

this answer solve my problem, many thanks!

i have this enviroment btw

Ionic CLI : 5.2.3  
Ionic Framework : ionic-angular 3.9.2  
@ionic/app-scripts : 3.2.2

Cordova:  
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)  
Cordova Platforms : android 7.1.4

---

<div class="post-metadata">

**Author:** ![zbahadir](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/zbahadir/32/120013_2.png) [@zbahadir](https://forum.ionicframework.com/u/zbahadir)\
**Post date:** [September 4, 2019, 12:53pm UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/20 "2019-09-04T12:53:46Z")

</div>

that’s how I solved the problem.

I add this line  
`android:usesCleartextTraffic="true"`  
to  
`platforms/android/app/src/main/AndroidManifest.xml`

```auto
<application android:hardwareAccelerated="true" 
android:icon="@mipmap/icon" 
android:label="@string/app_name" 
android:supportsRtl="true" 
`android:usesCleartextTraffic="true"`>

```

It looks that way.

---

<div class="post-metadata">

**Author:** ![cleaton](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@cleaton](https://forum.ionicframework.com/u/cleaton)\
**Post date:** [September 23, 2019, 8:16am UTC](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101/21 "2019-09-23T08:16:47Z")

</div>

this worked for me  
thanks

[Next page](https://forum.ionicframework.com/t/err-cleartext-not-permitted-in-debug-app-on-android/164101.md?page=2)
