Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sign Android App Bundle from Command Line

Tags:

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.

like image 758
hallz12 Avatar asked May 28 '18 06:05

hallz12


People also ask

Which command is used to generate a bundle?

In Android Studio, select “Build => Generate Signed Bundle / APK” and follow the dialog. Whether you use the command line or Android Studio, the process will leave you with a built and signed release bundle that's ready for upload to the Play Store.


1 Answers

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

like image 106
Jason Avatar answered Sep 22 '22 12:09

Jason