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

4

6

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]]

Wristband answered 2/7, 2017 at 19:21 Comment(0)
P
14

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 ^^

Pye answered 3/7, 2017 at 12:21 Comment(6)
You, sir, are a life a savor.Kauffmann
your welcom guys ^^ type it as the good respond for fast finding by other men who will need it . have a nice day of coding x)Pye
Yes, @AbdulRashid, you should mark this as the correct answer. Worked for me, too!Disvalue
jarsigner: Certificate chain not found for: myTransporter. myTransporter must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain - What does that mean please helpMidwinter
not working.. ERROR: JAR signer HELLO.RSA: JAR signature META-INF/HELLO.RSA uses digest algorithm 2.16.840.1.101.3.4.2.1 and signature algorithm 1.2.840.113549.1.1.1 wh ich is not supported on API Levels [[16, 17]]Leeds
Hi men sry for late but for further asker u will need to focus api level 26 as min api level ^^Pye
H
1

You need these steps:

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\android-release-unsigned-aligned.apk

apksigner sign --ks C:\Users\ali\Documents\transporterApp\myAppKey.keystore --ks-pass pass:[PASSWORD] --key-pass pass:[PASSWORD] --out C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-singned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned-aligned.apk

To sign applications use the BuildTools 24.0.3

https://developer.android.com/studio/releases/build-tools.html

Hagiocracy answered 4/7, 2017 at 17:14 Comment(1)
stackoverflow is a platform meant to be in English, so people with different native languages can communicate with each other. Please ask and answer in English. See: stackoverflow.blog/2009/07/23/non-english-question-policyMeasure
M
0

According to the official documentation, you can perform the following steps:

  1. generate the .apk file
  2. Align data: zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
  3. Sign the APK: apksigner sign --ks my-release-key.jks --out my-app-release.apk my-app-unsigned-aligned.apk

You may need to define the type of the keystore with the --ks-type option:

~/Android/Sdk/build-tools/26.0.2/apksigner sign --ks-type pkcs12 --ks ~/[…].p12 \
--out android-release-signed-aligned.apk android-release-unsigned-aligned.apk
Mambo answered 21/11, 2017 at 16:47 Comment(0)
I
0

This is fixed in apksigner 0.8 which was released in Android SDK Build Tools 26.0.2.

If any issue persists, please report at Google issue tracker they will re-open to examine.

Incogitant answered 2/1, 2018 at 6:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.