简体   繁体   中英

INSTALL_FAILED_INVALID_APK for debug only (release works)

I was running Android Studio 3.5. My code was compiling and installing onto the emulator just fine. I updated Android Studio to 3.6.1.

The only parts of my code that change are:

gradle updated from 5.4.1 to 5.6.4

Android gradle build tools updated from 3.5.3 to 3.6.1

Now I get the following error when trying to run the debug flavor (release works fine) of my app

Installation did not succeed. The application could not be installed: INSTALL_FAILED_INVALID_APK The APKs are invalid.

I have tried to delete the emulator and make a new one. I have tried clean, rebuild, invalidate cache. Nothing seems to be working.

Found the solution to my own problem. Note to others, make sure your libraries and classpaths are always up to date. I had a classpath for firebase plugins that was not up to date. When applying the new gradle, this problem occurred. After updating the classpath everything installed smoothly again

This problem is usually caused due to a difference in the mainfest package name and the Gradle applicationId.

First, check that they both are same.

Then, check that there are no spaces in the package name and it has proper (.) separators.

Also, check that it has no other separators (- or,) other than (.).

This should work for you.

Do post your manifest and Gradle configuration file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM