Sign Android App Bundle from Command Line

hallz12 picture hallz12 · May 28, 2018 · Viewed 10k times · Source

anyone know how to sign .aab file using new keystore from command line? The documentation here mentions that we can use jarsigner to sign our app bundle from the command line. but I cannot find the command line? Anyone know the command line?

I got this error when uploaded my bundle to Google Play:

You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner:

I try to sign the app bundle using this command:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore xample.jks bundle.aab keystoreAlias

Thank you very much.

Answer

Jason picture Jason · Jan 26, 2019

Probably you've already found a way to solve your problem. Nevertheless, since it may help someone in the future, I just wanted to say that I had the same problem and changing the hashing algorithm to SHA-256 helped me to overcome it.

jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore xample.jks bundle.aab keystoreAlias