3

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.

Javith J
  • 77
  • 2
  • 9

3 Answers3

3

Hope this help someone: What worked for was placing the whole path from the src folder. Example:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-app-key.keystore platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk app_alias

I'm using Cordova. The app was developed in Ionic

Matias
  • 31
  • 2
2

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

Dilan
  • 2,610
  • 7
  • 23
  • 33
0

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.

sergiotarxz
  • 520
  • 2
  • 14