APK upload failed for Alpha version. Errors from apksigner: Digest algorithm and Signature Algorithm Which is not supported on API levels [[16, 17]]

Abdul Rashid picture Abdul Rashid · Jul 2, 2017 · Viewed 8.4k times · Source

I had signed the APK by using keytool, jarsigner, and zipalign utlities.

I have used the following commands:

keytool -genkey -v -keystore myAppTransporterKey.keystore -alias myTransporter -keyalg RSA -keysize 2048 -validity 10000

cordova plugin rm cordova-plugin-console

cordova build --release android

jarsigner -verbose -keystore C:\Users\ali\Documents\transporterApp\myAppKey.keystore C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk myTransporter


jarsigner -verify C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk

After running:

jarsigner -verify -verbose -certs C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk

getting this message: jar verified

After running:

zipalign -v 4 C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\myTransporter-Final.apk

get the message: Verification succesful

After uploading to ALPAH in Google play console I am getting following error

Upload new APK to Alpha

Uploading

You have uploaded an APK with an invalid signature ( read more about signing ). Errors from apksigner: ERROR (Jar signer D2DTRANS.RSA): JAR signature META-INF / D2DTRANS.RSA uses digest algorithm 2.16.840.1.101.3.4.2.1 and Signature Algorithm 1.2.840.113549.1.1.1 Which is not supported on API levels [[16, 17]]

Answer

KABIA Edouard picture KABIA Edouard · Jul 3, 2017

You need these stepps :

1) jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\Users\ali\Documents\transporterApp\myAppKey.keystore C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk myTransporter

2) jarsigner -verify C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk

3) zipalign -v 4 C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\myTransporter-Final.apk

Hope this will help you ^^