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


One other solution would be just remove the ../android/app/build/outputs/apk/debug/app-debug.apk file and then run "npm run android" / "yarn android"