Ionic cordova application will not install properly to Android device

Issue

I updated everything I can think of on my machine. The app builds fine to iOS and was able to release it to the store.

I removed and re-added the Android platform and tried various build flags. I get a BUILD SUCCESSFUL message with no errors. I generated a signed bundle with the same keystore. Everything looks good in Android Studio event log when I run app to a device or emulator. I get a Launch succeeded message. The app icon gets added to the device, but it never launches. When I tap the app icon, I get a toast message saying Application not installed.

I don’t see any errors anywhere. The app deployed fine for me 4 months ago. I’ve since updated my machine and can’t get it running again with the current configuration.

Any help would be appreciated!


Ionic:

   Ionic CLI                     : 6.19.0 (/Users/USERNAME/.nvm/versions/node/v14.19.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.0.16
   @angular-devkit/build-angular : 13.3.9
   @angular-devkit/schematics    : 13.3.9
   @angular/cli                  : 13.3.9
   @ionic/angular-toolkit        : 6.1.0

Cordova:

   Cordova CLI       : 10.0.0 (cordova-lib@10.1.0)
   Cordova Platforms : android 10.1.2, ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 22 other plugins)

Utility:

   cordova-res (update available: 0.15.4) : 0.11.0
   native-run (update available: 1.7.0)   : 1.4.1

System:

   Android SDK Tools : 25.2.3 (/Users/USERNAME/Library/Android/sdk)
   ios-deploy        : 1.11.4
   ios-sim           : 8.0.2
   NodeJS            : v14.19.1 (/Users/USERNAME/.nvm/versions/node/v14.19.1/bin/node)
   npm               : 6.14.16
   OS                : macOS Big Sur
   Xcode             : Xcode 13.0 Build version 13A233


Android Studio Chipmunk 2021.2.1 Patch 2


java version "11.0.16" 2022-07-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.16+11-LTS-199)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16+11-LTS-199, mixed mode)
javac 11.0.16


.zprofile:
export PATH=${PATH}:/Users/USERNAME/Library/Android/sdk/platform-tools:/Users/USERNAME/Library/Android/sdk/tools:/Users/USERNAME/.gradle/wrapper/dists/gradle-7.1.1-all/1wqbeia0d49252rmlcr6o8lbl/gradle-7.1.1/bin:$GRADLE_HOME/bin:$GEM_HOME/bin:/Users/USERNAME/.gem/ruby/2.6.0/bin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.16.jdk/Contents/Home


<preference name="android-minSdkVersion" value="23" />
<preference name="android-compileSdkVersion" value="33" />
<preference name="android-targetSdkVersion" value="31" />


Plugins:
cordova-annotated-plugin-android 1.0.4 "cordova-annotated-plugin-android"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 3.0.0 "cordova-plugin-androidx"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-email-composer 0.9.2 "EmailComposer"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-firebase-analytics 6.1.0 "FirebaseAnalyticsPlugin"
cordova-plugin-firebase-messaging 6.1.1 "FirebaseMessagingPlugin"
cordova-plugin-inappbrowser 4.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-purchases 2.0.0 "Purchases"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-x-toast 2.7.2 "Toast"
cordova-sqlite-storage 6.0.0 "Cordova SQLite storage plugin - cordova-sqlite-storage plugin version"
cordova-support-android-plugin 1.0.2 "cordova-support-android-plugin"
cordova-support-google-services 1.4.0 "cordova-support-google-services"


Recent package updates
"@angular/fire": "~7.4.1",
"firebase": "~9.9.3",
"cordova-plugin-firebase-analytics": "^6.1.0",
"cordova-plugin-firebase-messaging": "^6.1.1",

Solution

I was finally able to solve this by rolling back to Android compile & target SDK 32. I noticed a new error about: Launchable activity must be exported. I had previously added a config hook to set the MainActvity to export=false. Upgrading Android required me to switch that to true. Lost 3 weeks of time upgrading the project and my machine to discover it was something simple. It works now though!

Ionic:

   Ionic CLI                     : 6.19.0 (/Users/jkufrin/.nvm/versions/node/v14.19.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.0.16
   @angular-devkit/build-angular : 13.3.9
   @angular-devkit/schematics    : 13.3.9
   @angular/cli                  : 13.3.9
   @ionic/angular-toolkit        : 6.1.0

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : android 11.0.0, ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 17 other plugins)

Utility:

   cordova-res (update available: 0.15.4) : 0.11.0
   native-run (update available: 1.7.1)   : 1.4.1

System:

   Android SDK Tools : 25.2.3 (/Users/jkufrin/Library/Android/sdk)
   ios-deploy        : 1.11.4
   ios-sim           : 8.0.2
   NodeJS            : v14.19.1 (/Users/jkufrin/.nvm/versions/node/v14.19.1/bin/node)
   npm               : 6.14.16
   OS                : macOS Big Sur
   Xcode             : Xcode 13.0 Build version 13A233

Answered By – jkufrin

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *