'jarsigner' returned with error #1

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Santiago
:warning: Old Version Published before Godot 3 was released.

Hi people!
I was trying to export a simple little project to android to see test some things, but I have problems exporting, related (apparently) to the jarsigner.
I have tried searching on the web for solutions before coming here, but nothing seems to fix this situation.

The situation is this: according to other people that had the same problem, changing some parameters while generating the keystore seemed to fix the issue.
but I’ve tried all ways to generate the keystore and nothing works.

Here’s what I’ve tried.

keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999

…and…

keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -sigalg MD5withRSA -keyalg RSA

… I’ve tried both keystores, in the android section on editor setting, and when the export window asks me for a release keystore (I guess I can use the same keystore both for debug and release), but also I’ve tried with different keystores for those two, and nothing seems to fix the problem.

So… anyone has any idea whats the issue here?

SIde Note 1: The APK file seems to be exported anyway but, whan trying to install the app on the phone, after enabling unknown sources, the installation fails.

Side Note 2: I haven’t tried running the project directly from the editor while conecting the android phone to the PC, because the only android phone I have acces to is not mine (D:), so I don’t want to mess up with the developer mode on a phone that’s not mine.

Thanks in advance!!!

Oh I forgot to mention that i’m using godot 2.0.2 on Ubuntu 15.04 with openJDK 6, as recommended in the “exporting for android” tutorial on the godot docs

Santiago | 2016-04-12 22:34

Did you solve this? I have an Android app and there are many issues/gotchas with doing this in Godot. Posting the error messages might help. Your first key won’t work because you’ve specified RSA and Godot is hard coded for MD5withRSA. I haven’t tried an MD5withRSA key but strangely, one created with Sha1WithRSA seems to work ok. Although, I’m on Windows so there might be differences there :confused:

duke_meister | 2016-05-27 01:37

Hi duke, I still have this problem on ubuntu, the only workaround I’ve found is to use the editor on windows, I have no problems there, but I’d like to fix this problem on ubuntu.

As for the error messages, the only one I got while exporting is the “‘jarsigner’ returned with error #1” but nothing more.

I’ll try and use a key without the RSA specified, I thought that following the tutorial on the godot wiki for generating a keystore would work.

Thanks for the help!
I’ll comment on this if I solve this!

Santiago | 2016-05-27 22:03

Which keystore creation command that you posted works for you? I’m hoping the second one with -sigalg MD5withRSA just for some sanity (because the first one shouldn’t work IMO). I’ve spent the last 3 days solid (and many more before that over the weeks) trying to work out how to reliably deploy to Android from Godot. Just when I think I’ve got a handle on it, something else pops up. BTW you have -keyalg RSA twice in your second command line above.

By the way you can jarsign manually, which might get around the problem for you in Linux.

duke_meister | 2016-05-27 22:48

Sorry for replying late :frowning:
Honestly, I haven’t tried anything with the jarsigner on ubuntu, for now anytime I need to export I go to Windows hehe, but I’ll try soon enough and tell you my findings.
Thank you for the help!

Santiago | 2016-08-10 19:30

Hi again! I’ve been trying again to compile and use de deploy function, and now I don’t get the error any more (using the kaystore generated from the code on the godot docs, and the jarsigner from jdk1.8.0_101), but when I try to use deploy on my android device, connected via usb and with developer functions enabled, godot seems to build the apk to deploy without problems, but after the process is done, the device don’t load the apk, and even if I export the apk normally and try to install it via “adb install my-game.apk” I get the [INSTALL_PARSE_FAILED_NO_CERTIFICATES] error, so I don’t know what to do any more.

All of this was tested on Ubuntu; on windows I have no problems deploying small games, but for some “big” games like 3d platformer sample, the device will freeze or don’t load the game at all.

So I’m stuck again but at least is a new error :smiley:

Santiago | 2016-09-22 13:24

Hey, I thought I’d share what solved in my case: I mistakenly selected the “apksigner” executable in the Android sdk instead of the “jarsigner” in the Godot Editor settings (I know this was a stupid mistake… lol). Choosing the jarsigner instead solved this problem for me. :stuck_out_tongue:

rafgp | 2019-11-08 04:05

:bust_in_silhouette: Reply From: undeton

This problem happen when you give to GODOT engine wrong keystore password.
solve:
Fist goto jdk directory to regenerate new keystore:
1: keytool -genkey -v -keystore debug.keystore -alias debug -keyalg RSA -keysize 2048 -validity 10000
2: goto Editor-> Editor Settings > Export > Android.
3:Debug keystore field: Point to keystore file in JDK folder.
4: replace field Debug keystore user: to name that keysore.
5: replace field Debug keystore password: password when you generate keystore.

It should work.