Ionic application not installed on android 11

i have an application with ionic 5 and when i try to install it on android 11 give me error application not installed. plz help me to fix that

config.xml

 <preference name="android-targetSdkVersion" value="31" />
    <preference name="android-minSdkVersion" value="22" />

Use

1- Angular CLI: 10.0.5

2- Node: 12.18.3

3- ionic 6.11.8

4- gradle
Gradle 6.5.1

Build time: 2020-06-30 06:32:47 UTC
Revision: 66bc713f7169626a7f0134bf452abde51550ea0a

Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant™ version 1.10.7 compiled on September 1 2019
JVM: 14.0.1 (Oracle Corporation 14.0.1+14)
OS: Mac OS X 10.16 x86_64

please help me

is there anyone to help me?

i added cordova 10 as mentioned in below link
https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html

in android 11 just show me white screen


i removed whitelist plugin according below text becuase when i tried to build android app, gives me error whiteplugin symbol not found

Existing projects using Cordova Android 10 or greater should remove this plugin with the following command:

cordova plugin rm cordova-plugin-whitelist

when open chrome://inspect
show me this errors

in server file we added origin

Fixed ionic 6 application not installed on android 11

do below things step by step

To Add Android 11 Support You Need To Install

  • Cordova 10

  • latest version of android studio

  • android build tools 30.0.2

  • android sdk platform level 30

1- updgrade your cordova to cordova version 10.0.0

you can remove your old cordova with type this code in terminal

npm uninstall -g cordova

and then install cordova version 10.0.0

npm install -g cordova@10.0.0

2- update Android SDK Platform to level 30 and 31 (but for android 11 level 30 is ok ) from android studio exactly like below image

3- update Android SDK Build Tools from android studio exactly like below image

4- update your Android Studio Version like below image

5- remove old platform from your project and add new android project

ionic cordova platform add android@latest  or ionic cordova platform add android@10.0.0
latest version is 10.1.0 now 

5- upgrade your gradle to 7.1.1 (this section will happen automate after you add android@10.x to your project)

if you give an error about gradle version just check below image your wrapper should be the same

5.1- add to config.xml

    <preference name="android-targetSdkVersion" value="30" />
    <preference name="hostname" value="localhost" />
    <preference name="AndroidInsecureFileModeEnabled" value="true" />

6- prepare android

ionic cordova prepare android 

7- build your app

ionic cordova build android --prod 

run your app on emulator (android 11) and check console in chrome://insepct

if you get this error

ionic Failed to load resource: net::ERR_FILE_NOT_FOUND

open config.xml file and and some code

     <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="*" />
    <allow-navigation href="data:*" />
    <allow-intent href="*" />
    <access origin="*" />

and for me i changed tsconfig.json file

“target”: “es5”,

if you get whitelist error when build android app just remove whitelist

With the Allow List functionality now integrated into the core of Cordova Android (10.x and greater), this plugin is no longer required.

ionic cordova plugin rm cordova-plugin-whitelist

For me This changes work i hope it will help

below links maybe help as refrences
1-whitelist
2-cordova

1 Like