Search code examples
androidcordovajar-signing

Cordova build and signing error when I try to upload to google play store, no v2 signature


I'm trying to upload my signed apk to the google play store

The error message is:

Error de apksigner: ERROR (Jar signer CERT.DSA): No APK Signature Scheme v2 signature from this signer ERROR (APK Signature Scheme v2 signer #0): No JAR signature from this signer

I have the keystore information in my build.json file

The keystore was created with Visual Studio 2015

I created the apk with

cordova build android --release

The apk file works fine in my android phone, what should I do to build an apk for google play store?


Solution

  • This suggests that the signing certificate(s) in the APK's JAR signature doesn't match the signing certificate(s) in the APK's APK Signature Scheme v2 signature. Typically this is caused by non-standard signing tools which fail to strip existing (usually debug) signatures when re-signing.

    Such an APK will install fine because pre-Nougat Androids see only JAR signatures whereas Nougat and newer Androids will ignore the JAR signatures of this APK (because there's an APK Signature Scheme v2 signature). You will, however, run into an issue when a pre-Nougat Android with this APK installed upgrades to Nougat or newer. Updates to this APK will be rejected because they will be seen as signed with a different certificate. This situation is what Play is trying to prevent.

    To troubleshoot, try running:

    apksigner verify -v --print-certs --max-sdk-version 23 my.apk
    apksigner verify -v --print-certs --min-sdk-version 24 my.apk
    

    The first command will output the signing certificate(s) as seen by pre-Nougat Androids. The second command will output the signing certificate(s) as seen by Nougat and newer Androids. This might give you an idea which signing certificate(s) are wrong.