Jarsigner: unable to open jar file: android-release-unsigned.apk

I get this error when I try to sign my .apk

jarsigner: unable to open jar file: android-release-unsigned.apk

I’ve no idea why this is happening. I’m using:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore android-release-unsigned.apk my-alias

My keystore is .keystore format, not .jks.

I’m sure I’m using the right passphrase, password and alias because I experimented using the wrong ones and I get appropriate errors.

I’m running this from within the /release folder so it’s not a path error.

Why won’t it sign?

4 Likes

Problem solved.

The docs need updating.

When you build a release the name of the file is app-release-unsigned.apk, NOT android-release-unsigned.apk

This really should be corrected in the docs!

12 Likes

This didn’t solve the problem for me… I tried also running terminal as administrator but didn’t work…

1 Like

What error are you getting?

A also have this problem. When i changed to “app-release-unsigned.apk”, I got the error:

jarsigner: unable to open jar file: app-release-unsigned.apk

Did you find any different solution?

1 Like

So I just ran into this issue, but realized the apk file already has the .apk extension attached to it. So all you have to input is “app-release-unsigned”. Mine worked after I removed the extension. Hope this helps!

None of these methods worked for me. Not sure what else to do.

Uninstall and reinstall.

You need to include the relative path to the apk

platforms/android/build/outputs/apk/android-release-unsigned.apk
18 Likes

This path worked for me…

platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk

13 Likes

The path didn’t worked. But i copied the apk to parent folder. That worked!

11 Likes

Thanks this work for me :wink:

1 Like

Thank you so much it helped me a lot

1 Like

Thanks Passing the path worked for me

This worked, thanks!

Thanks bro! been trying to figure this out for the last 4 to 5 hours. Not sure when it was changed. Was building one one Sunday and it’s all good!

another way to do this is:

  1. open project in android studio
  2. go to “Build > Generate Signed APK”
  3. go “Next”
  4. click on “choose existing” button, then import your ****.keystore file
  5. type pass and alias of your keystore file
  6. go next and checked your “Signature version” and then finish
1 Like

Hi, im dont know which doc i should to change the name

Thanks that worked for me

Thanks. its working. Really need to update ionic document.