Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App not installing in Android 11 but works on previous versions

I have an app with two packages com.example.package and com.other.package. My configurations in build.gradle is as follows:

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.example.package"
        minSdkVersion 18
        targetSdkVersion 30

I build an unsigned release build. Then I sign it with

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystore> <OUTPUT> <ALIAS>

The build I get from this works well on all versions except for Android 11. On android 11 when I install my app I get the following error:

adb: failed to install ginger-uk.apk: Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]

So I tried zip aligning the APK and installing but then I get the following error on Android 11:

App not installed error

I then tried to zipalign first before signing based on some stackoverflow solution but I get the following error on Android 11:

adb: failed to install ginger-uk.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Scanning Failed.: No signature found in package of version 2 or newer for package com.other.package]

My Question is has anyone successfully signed an APK for android 11 and below? and how do you do this?

like image 985
ProGaymer Avatar asked Oct 15 '20 03:10

ProGaymer


People also ask

Why apps are not installing in Android 11?

Corrupted storage, especially corrupted SD cards, is one of the most common reasons why Android app not installed error occurs. Unwanted data might contain elements that disturb the storage location, causing Android app can't install error.


1 Answers

For those using MS AppCenter to do builds, you need to delete and redo the build configuration, including uploading your keystore file again. You can check for the correct signing used by looking at the log

Task         : Android signing
Description  : Sign and align Android APK files
Version      : 3.193.0  <-- must be larger than 1.x

Source: https://github.com/microsoft/appcenter/issues/1990#issuecomment-861053082

like image 111
mir Avatar answered Sep 27 '22 18:09

mir