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

#1

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?

3 Likes
#2

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!

8 Likes
#3

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

1 Like
#4

What error are you getting?

#5

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

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!

#8

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

#10

Uninstall and reinstall.

#11

You need to include the relative path to the apk

platforms/android/build/outputs/apk/android-release-unsigned.apk
12 Likes
#12

This path worked for me…

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

6 Likes
#13

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

7 Likes
#14

Thanks this work for me :wink:

1 Like
#15

Thank you so much it helped me a lot

1 Like
#16

Thanks Passing the path worked for me

#17

This worked, thanks!

#18

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!

#19

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
#20

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

#21

Thanks that worked for me

#22

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