简体   繁体   中英

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

I am currently working on cordova project and I tried to generate key with the set of lines

keytool -genkey -v -keystore <myappname.keystore> -alias <myappname> -keyalg RSA -keysize 2048 -validity 10000

I also generated a keystore after that I used the below line

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <myappname.keystore> app-release-unsigned.apk <myappname>

but I get this issue

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

Can anyone help me with the solution. Thanks in advance.

In the application root:

cd platforms/android
./gradlew assembleRelease
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <myappname.keystore> app/build/outputs/apk/release/app-release-unsigned.apk <myappname>

I've suppossed you are really using Cordova not Ionic.

hey I know this kind of late to answer, but also came to this issue and i kept doing was copy paste the jarsigner code instead of giving the path to the APK below is the code

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -my-release-key.keystore <whatever_the_path_is_to_your_apk_file\app-release-unsigned.apk> alias_name

hope this help others who comes to this stack....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM