PackageParserException: Package ...base.apk has no certificates at entry AndroidManifest.xml

Viewed 7328

I'm running my app in debug mode and it's ok. But when I sign it and try to install apk, this error happens in Logcat, and phone shows "App is not installed".

This is the same on every phone with <7.0 android, so I thought the problem is in app signature, but I've tried both V1, V2, only V1 - seems like android studio doesn't even recognise that I changed something.

Tried to disable V2 completely with this, but no luck.

signingConfigs{
    release {
        storeFile file("keystore.jks")
        storePassword 'password'
        keyAlias 'alias'
        keyPassword 'password'
        v2SigningEnabled false
    }
}

What else can I do?

C:\Program Files\Android\Android Studio\jre\jre\bin>java -version
openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
OpenJDK 64-Bit Server VM (build 25.152-b01, mixed mode)    
3 Answers

Today I've updated Android Studio to 3.3 and encountered the same issue.

I fixed it after delete Build folder, Clean Project, Invalidate Caches/Restart. And after that I could generate signed application via Build -> Generate Signed Bundle/APK with only V1 signature.

Build signed application with signingConfigs release still doesn't work.

You can try my solution.

Ok I solved it by making those actions, but I don't sure what actually fixed it. Anyway :

  1. copy all the code into another project (weird?)

  2. create another keystore

  3. remove all functions that require newest java features and therefore newest Android

  4. after that, only choose v1 jar signature

Steps to generate signed apk:

  1. Build release unsigned apk.
  2. zipalign the unsigned APK using the command prompt.

    zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
    
  3. Signed the APK with Sonim private key using app signer via command prompt.

    apksigner sign --ks my-release-key.jks --out my-app-release.apk my-app-unsigned-aligned.apk
    
  4. Install the apk in device.

Related