Unable to sign apk with jarsigner


#1

I’ve looked at the other questions and answers and no one seems to have the same issue.

I get this error:

jarsigner: unable to create: android-release-unsigned.apk.sig

I know the passphrase and key password are correct because if I purposely put in the wrong ones I get these errors, respectively:

jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect

jarsigner: unable to recover key from keystore

So if it’s not a password issue what can it be? I’m using this format, and both the apk and keystore are in in the same folder I’m running this command from:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name

Any ideas?


#2

Hello,

maybe it helps, when you use standard name android-release-unsigned.apk and make the naming later with zipalign.

Best regards, anna-liebt


#3

I already do this and then name it properly with zipalign.


#4

Permissions.

Which folder are you running the command in? Can your terminal write there?


#5

It’s the same app, same folder. This is already in the Play Store. I’m
doing an update. Nothing has changed.


#6

Did jarsigner maybe get upgradet with Android Studio or something?
Tried running your console as admin?


#7

I’ve run the command with sudo. That did it. Thanks.