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

2k Views Asked by At

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?

2

There are 2 best solutions below

2
Alex Klyubin On BEST ANSWER

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.

0
diazwijaya On

If you can run apksigner, try to sign your apk using this.

apksigner sign --ks yourkeystore.keystore yourapk.apk

You'll be prompted to input your keystore password. After that, you can check the signing with

apksigner verify -v yourapk.apk

Make sure that it will return:

Verifies
Verified using v1 scheme (JAR signing): true
Verified using v2 scheme (APK Signature Scheme v2): true

If that's OK, you can upload your signed APK to Play Store.