Cordova ionic app not working on Android 9 && 10


My ionic application not working on android 9 devices, works perfectly fine on android device with version less than 9.
Application doesn’t connect to backend upon loading the landing page.
Any ideas ?

Environment I am using :

ionic (Ionic CLI) : ^5.0.0
Angular ^7.2.2


cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 8.0.0


Android SDK Tools : 29
NodeJS : v10
npm : 6.2.0



This is due to this policy starting in Android 9 :

Applications intending to connect to destinations using only secure connections can opt-out of supporting cleartext (using the unencrypted HTTP protocol instead of HTTPS) to those destinations.

Note: The guidance in this section applies only to apps that target Android 8.1 (API level 27) or lower. Starting with Android 9 (API level 28), cleartext support is disabled by default.

Cleartext (HTTP traffic) is now disabled by default, so it amounts to having something like this

<domain-config cleartextTrafficPermitted="false">
  <domain includeSubdomains="true">*</domain>


Replace all http calls with https URLs.


Force HTTP (not secure)

If you really need to allow HTTP traffic for some requests, you can do so by adding some config in your Android Manifest, or create a plugin to update the manifest every time you rebuild the app from scratch.

You need to add an attribute to the <application> tag in the manifest, so to not overwrite everything, you need to use the <edit-config> tag with mode="merge" (see: )

HTTP is not considered a secure protocol, and every request sent (and its payload) can be read by an attacker, so be careful


<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns=""
        id="phonegap-plugin-old-http-support-android" version="0.0.1">

    <description>Force HTTP for Android 9+</description>

        <engine name="cordova" version=">=6.0.0"/>
        <engine name="cordova-android" version=">=7.0.0"/>

    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="OldHttpSupportPlugin">
                <param name="android-package" value="YOUR.PACKAGE.plugin.OldHttpSupportPlugin"/>

        <!-- Source file for Android -->
        <source-file src="src/android/network_security_config.xml" target-dir="res/xml/" />

        <edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
            <application android:networkSecurityConfig="@xml/network_security_config" />


<?xml version="1.0" encoding="utf-8"?>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true"></domain>
        <domain includeSubdomains="true"></domain>
        <domain includeSubdomains="true">111.222.333.444</domain>

Answered By – A Charron

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published