Skip to content Skip to sidebar Skip to footer

Why Does The Android Sdk 30 Generate Invalid Apk Files?

I built a new Java Android app on a new PC using a fresh install of Android Studio 4.1.2, and was able to run it on my phone from the debugger fine. However, when I built a signed

Solution 1:

To find out why your APK is not installing, use command line adb tool to install it:

adb install myapp.apk

If the installation fails, adb will print an error message describing the reason.

One possible reason for failing to install from file browser is if the debug version of your app is still installed on your phone.

The signed version would have the same package name but different signature, so the OS will not install it.

Solution 2:

OK, solved now. Thanks to Lev M for the suggestion to use adb to try and install the app. That showed what the issue was straight away!

The problem was that when I was building the signed APK file, I was only ticking the "V1 (Jar Signature)" option, but I also needed to tick "V2 (Full APK Signature)". It looks like you need V2 signing for SDK 30 onwards.

This is confirmed here: https://developer.android.com/about/versions/11/behavior-changes-11

Post a Comment for "Why Does The Android Sdk 30 Generate Invalid Apk Files?"