How to fix INSTALL_FAILED_INVALID_APK error in Android Studio?
I tried updating the Android Studio but it still get the INSTALL_FAILED_INVALID_APK error. Then I updated the firebase dependencies and still to no avail
Interestingly though, it worked smoothly on another project that I have. Which led me to check which dependencies they differ in and realized that the only major dependency is the AppDynamics gradle plugin
I remove the AppDynamics instrumentation and it worked! I am assuming that even before, the AppDynamics instrumentation in gradle was the cause that prevented the app from running properly. I have confirmed it is an issue with the AppDynamics plugin. See link for reference: https://community.appdynamics.com/t5/End-User-Monitoring-EUM/AppDynamic-EUM-setup-for-Android-Cordova-project/td-p/38864
For the meantime, I will be downgrading until AppDynamics provides a fix
Android INSTALL_FAILED_INVALID_APK base.apk is missing after updating to gradle plugin 7.2.1
Eventually, I found out that the issue was caused by testCoverageEnabled true
in my build.gradle buildType. I don't know how and why, and it is not an ideal situation, but removing it, fixed the problem.
August 16, 2022
With gradle plugin version 7.2.2 from latest update the problem seems to be fixed and I can again build APKs with testCoverageEnabled true
.
Targeting SDK Android Q results in Failed to finalize session : INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2
This happens because of an issue with zipalign, see - https://issuetracker.google.com/issues/37045367. You need to set extractNativeLibs
in your Application Tag on AndroidManifest.xml
<application
android:allowBackup="false"
android:label="@string/app_name"
android:extractNativeLibs="true"
...
>
If you are using adb
to install the apk try adding -t
flag
adb install -t <path-to-apk>
Related Topics
How to Get Ndk-Gdb Working on Android
What Is the Default Font Family in Android
How to Programmatically Add a Submenu Item to the New Material Design Android Support Library
Launching Activity from Widget
How to Use Google Login API with Cordova/Phonegap
Dialogfragment with Clear Background (Not Dimmed)
Create/Copy File in Android Q Using Mediastore
Migration from Gcm to Fcm Needed
Android How to Programmatically Hide Launcher Icon
Android Application Class Lifecycle
Adding Tab Inside Fragment in Android
Calculate the Size of a List View or How to Tell It to Fully Expand