Skip to main content
added 223 characters in body
Source Link
Gvs Akhil
  • 2.4k
  • 2
  • 20
  • 35

Update December 2019 ionic - 4.7.1

<manifest xmlns:tools=“http://schemas.android.com/tools”>

<application android:usesCleartextTraffic=“true” tools:targetApi=“28”>

Please add above content in android manifest .xml file

Previous Versions of ionic

  1. Make sure you have the following in your config.xml in Ionic Project:

     <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>
    
  2. Run ionic Cordova build android. It creates Android folder under Platforms

  3. Open Android Studio and open the Android folder present in our project project-platforms-android. Leave it for few minutes so that it builds the gradle

  4. After gradle build is finished we get some errors for including minSdVersion in manifest.xml. Now what we do is just remove <uses-sdk android:minSdkVersion="19" /> from manifest.xml.

Make sure its removed from both the locations:

  1. app → manifests → AndroidManifest.xml.
  2. CordovaLib → manifests → AndroidManifest.xml.

Now try to build the gradle again and now it builds successfully

  1. Make sure you have the following in Application tag in App → manifest → Androidmanifest.xml:

     <application
     android:networkSecurityConfig="@xml/network_security_config"  android:usesCleartextTraffic="true" >
    
  2. Open network_security_config (app → res → xml → network_security_config.xml).

Add the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">xxx.yyyy.com</domain>
        </domain-config>
    </network-security-config>

Here xxx.yyyy.com is the link of your HTTP API. Make sure you don't include any Http before the URL.

Note: Now build the app using Android Studio (Build -- Build Bundle's/APK -- Build APK) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic Cordova build android it overrides all these settings so make sure you use Android Studio to build the Project.

If you have any older versions of app installed, Uninstall them and give a try or else you will be left with some error:

App not Installed

  1. Make sure you have the following in your config.xml in Ionic Project:

     <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>
    
  2. Run ionic Cordova build android. It creates Android folder under Platforms

  3. Open Android Studio and open the Android folder present in our project project-platforms-android. Leave it for few minutes so that it builds the gradle

  4. After gradle build is finished we get some errors for including minSdVersion in manifest.xml. Now what we do is just remove <uses-sdk android:minSdkVersion="19" /> from manifest.xml.

Make sure its removed from both the locations:

  1. app → manifests → AndroidManifest.xml.
  2. CordovaLib → manifests → AndroidManifest.xml.

Now try to build the gradle again and now it builds successfully

  1. Make sure you have the following in Application tag in App → manifest → Androidmanifest.xml:

     <application
     android:networkSecurityConfig="@xml/network_security_config"  android:usesCleartextTraffic="true" >
    
  2. Open network_security_config (app → res → xml → network_security_config.xml).

Add the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">xxx.yyyy.com</domain>
        </domain-config>
    </network-security-config>

Here xxx.yyyy.com is the link of your HTTP API. Make sure you don't include any Http before the URL.

Note: Now build the app using Android Studio (Build -- Build Bundle's/APK -- Build APK) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic Cordova build android it overrides all these settings so make sure you use Android Studio to build the Project.

If you have any older versions of app installed, Uninstall them and give a try or else you will be left with some error:

App not Installed

Update December 2019 ionic - 4.7.1

<manifest xmlns:tools=“http://schemas.android.com/tools”>

<application android:usesCleartextTraffic=“true” tools:targetApi=“28”>

Please add above content in android manifest .xml file

Previous Versions of ionic

  1. Make sure you have the following in your config.xml in Ionic Project:

     <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>
    
  2. Run ionic Cordova build android. It creates Android folder under Platforms

  3. Open Android Studio and open the Android folder present in our project project-platforms-android. Leave it for few minutes so that it builds the gradle

  4. After gradle build is finished we get some errors for including minSdVersion in manifest.xml. Now what we do is just remove <uses-sdk android:minSdkVersion="19" /> from manifest.xml.

Make sure its removed from both the locations:

  1. app → manifests → AndroidManifest.xml.
  2. CordovaLib → manifests → AndroidManifest.xml.

Now try to build the gradle again and now it builds successfully

  1. Make sure you have the following in Application tag in App → manifest → Androidmanifest.xml:

     <application
     android:networkSecurityConfig="@xml/network_security_config"  android:usesCleartextTraffic="true" >
    
  2. Open network_security_config (app → res → xml → network_security_config.xml).

Add the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">xxx.yyyy.com</domain>
        </domain-config>
    </network-security-config>

Here xxx.yyyy.com is the link of your HTTP API. Make sure you don't include any Http before the URL.

Note: Now build the app using Android Studio (Build -- Build Bundle's/APK -- Build APK) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic Cordova build android it overrides all these settings so make sure you use Android Studio to build the Project.

If you have any older versions of app installed, Uninstall them and give a try or else you will be left with some error:

App not Installed

added 22 characters in body
Source Link
double-beep
  • 5.4k
  • 19
  • 37
  • 45

Ok so here is the working solution:

Step 1:Make sure you have the following in your config.xml in Ionic Project

<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>

Step2: Run ionic cordova build android

It creates Android folder under Platforms

Step3: Open Android Studio and open the Android folder present in our project project-platforms-android Leave it for few minutes so that it builds the gradle

Step4: ** After gradle build is finished we get some errors for including minSdVersion in manifest.xml** Now what we do is just remove from manifest.xml

  1. Make sure you have the following in your config.xml in Ionic Project:

     <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>
    
  2. Run ionic Cordova build android. It creates Android folder under Platforms

  3. Open Android Studio and open the Android folder present in our project project-platforms-android. Leave it for few minutes so that it builds the gradle

  4. After gradle build is finished we get some errors for including minSdVersion in manifest.xml. Now what we do is just remove <uses-sdk android:minSdkVersion="19" /> from manifest.xml.

  1. app -> manifests-> AndroidManifestAndroidManifest.xml.xml
  2. CordovaLib -> manifests -> AndroidManifestAndroidManifest.xml.xml

Step5: Make sure you have the following in Application tag in App -> manifest -> Androidmanifest.xml

<application
android:networkSecurityConfig="@xml/network_security_config" android:usesCleartextTraffic="true" >

Step6: Open network_security_config (app -> res -> xml -> network_security_config.xml)

  1. Make sure you have the following in Application tag in App → manifest → Androidmanifest.xml:

     <application
     android:networkSecurityConfig="@xml/network_security_config"  android:usesCleartextTraffic="true" >
    
  2. Open network_security_config (app → res → xml → network_security_config.xml).

Add the following Codecode:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">xxx.yyyy.com</domain>
        </domain-config>
    </network-security-config>

Here xxx.yyyy.com is the link of your http api. Make sure you dont include any Http before the url Here xxx.yyyy.com is the link of your HTTP API. Make sure you don't include any Http before the URL.

Note: Now build the app using Android Studio(Build -- Build Bundle's/Apk -- Build Apk) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic cordova build android it overrides all these settings so make sure you use Android Studio to build the Project Note: Now build the app using Android Studio (Build -- Build Bundle's/APK -- Build APK) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic Cordova build android it overrides all these settings so make sure you use Android Studio to build the Project.

If you have any older Versions of app installed, Uninstall them and give a try or else you will be left with some error(App not Installed) If you have any older versions of app installed, Uninstall them and give a try or else you will be left with some error:

App not Installed

Ok so here is the working solution:

Step 1:Make sure you have the following in your config.xml in Ionic Project

<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>

Step2: Run ionic cordova build android

It creates Android folder under Platforms

Step3: Open Android Studio and open the Android folder present in our project project-platforms-android Leave it for few minutes so that it builds the gradle

Step4: ** After gradle build is finished we get some errors for including minSdVersion in manifest.xml** Now what we do is just remove from manifest.xml

  1. app -> manifests-> AndroidManifest.xml
  2. CordovaLib -> manifests -> AndroidManifest.xml

Step5: Make sure you have the following in Application tag in App -> manifest -> Androidmanifest.xml

<application
android:networkSecurityConfig="@xml/network_security_config" android:usesCleartextTraffic="true" >

Step6: Open network_security_config (app -> res -> xml -> network_security_config.xml)

Add the following Code:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">xxx.yyyy.com</domain>
    </domain-config>
</network-security-config>

Here xxx.yyyy.com is the link of your http api. Make sure you dont include any Http before the url

Note: Now build the app using Android Studio(Build -- Build Bundle's/Apk -- Build Apk) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic cordova build android it overrides all these settings so make sure you use Android Studio to build the Project

If you have any older Versions of app installed, Uninstall them and give a try or else you will be left with some error(App not Installed)

  1. Make sure you have the following in your config.xml in Ionic Project:

     <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>
    
  2. Run ionic Cordova build android. It creates Android folder under Platforms

  3. Open Android Studio and open the Android folder present in our project project-platforms-android. Leave it for few minutes so that it builds the gradle

  4. After gradle build is finished we get some errors for including minSdVersion in manifest.xml. Now what we do is just remove <uses-sdk android:minSdkVersion="19" /> from manifest.xml.

  1. app manifestsAndroidManifest.xml.
  2. CordovaLib manifests AndroidManifest.xml.
  1. Make sure you have the following in Application tag in App → manifest → Androidmanifest.xml:

     <application
     android:networkSecurityConfig="@xml/network_security_config"  android:usesCleartextTraffic="true" >
    
  2. Open network_security_config (app → res → xml → network_security_config.xml).

Add the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <domain-config cleartextTrafficPermitted="true">
            <domain includeSubdomains="true">xxx.yyyy.com</domain>
        </domain-config>
    </network-security-config>

Here xxx.yyyy.com is the link of your HTTP API. Make sure you don't include any Http before the URL.

Note: Now build the app using Android Studio (Build -- Build Bundle's/APK -- Build APK) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic Cordova build android it overrides all these settings so make sure you use Android Studio to build the Project.

If you have any older versions of app installed, Uninstall them and give a try or else you will be left with some error:

App not Installed

Source Link
Gvs Akhil
  • 2.4k
  • 2
  • 20
  • 35

Ok so here is the working solution:

Step 1:Make sure you have the following in your config.xml in Ionic Project

<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>

Step2: Run ionic cordova build android

It creates Android folder under Platforms

Step3: Open Android Studio and open the Android folder present in our project project-platforms-android Leave it for few minutes so that it builds the gradle

Step4: ** After gradle build is finished we get some errors for including minSdVersion in manifest.xml** Now what we do is just remove from manifest.xml

Make sure its removed from both the locations:

  1. app -> manifests-> AndroidManifest.xml
  2. CordovaLib -> manifests -> AndroidManifest.xml

Now try to build the gradle again and now it builds successfully

Step5: Make sure you have the following in Application tag in App -> manifest -> Androidmanifest.xml

<application
android:networkSecurityConfig="@xml/network_security_config" android:usesCleartextTraffic="true" >

Step6: Open network_security_config (app -> res -> xml -> network_security_config.xml)

Add the following Code:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">xxx.yyyy.com</domain>
    </domain-config>
</network-security-config>

Here xxx.yyyy.com is the link of your http api. Make sure you dont include any Http before the url

Note: Now build the app using Android Studio(Build -- Build Bundle's/Apk -- Build Apk) and now you can use that App and it works fine in Android Pie. If you try to build app using ionic cordova build android it overrides all these settings so make sure you use Android Studio to build the Project

If you have any older Versions of app installed, Uninstall them and give a try or else you will be left with some error(App not Installed)