Alias does not show up in Publishing Settings

Hi, first of all, I have JDK’s Keytool on Windows’s PATH and I use it successfully in Eclipse to sign Android apks.

Unity seems to be able to use the keytool to generate a Keystore with a Alias, but I get an error on console saying the Alias already exists! I have verified the generated user.keystore and it is valid, I can use it to sign apks through Eclipse.

The problem is Unity does not show the Alias in the Alias combobox of Publishing Settings, so I can only choose between “Unsigned (debug)” and “Create a new key”.

Before you ask: Yes, I have checked the “Use Existing Keystore” and browsed to the generated user.keystore.

Any ideas?

Thanks in advance.

The alias combo box will only show the key alias from the keystore when the keystore passwords match and are correct; could that be the problem? Any output in the console that could provide a hint? Does it work if you create a new keystore + keyalias from scratch?

No, they are correct.

When I create a new keystore from scratch, I get this:

Error while running ‘keytool’:
C:\Program Files (x86)\Java\jdk1.6.0_23\bin\keytool.exe -genkey -keystore “F:/Workspace/user.keystore” -storepass 12345678 -alias test -keypass 12345678 -validity 18250 -dname “O=test”
…didn’t generate a new key inside existing keystore!

UnityEditor.HostView:OnGUI()

Assert in file AndroidKeystoreWindow.cs at line: 335

But it seams it creates the keystore successfully anyway because I can use it to sign apks through Eclipse.

When I try to create the keystore again after the error above, it says the alias already exists, as expected.

Judging from that error you already have a file called user.keystore ? Do you get same if you create a new keystore under a different name?
if you copy paste the command line from the error message and execute it in a cmd.exe window; do you get errors there too ?
If you execute

C:\Program Files (x86)\Java\jdk1.6.0_23\bin\keytool.exe -list -keystore "F:/Workspace/user.keystore" -storepass 12345678

from cmd.exe; what does the output look like?

http://img602.imageshack.us/f/unityandroid.png/

The error always happens when adding a new alias key, even after creating a new keystore with a different name.

The cmd output:

OUTPUT:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

test, Jan 13, 2011, PrivateKeyEntry,
Certificate fingerprint (MD5): 18:F0:E3:E3:smile:7:39:22:90:4C:1B:3A:C3:FD:smile:A:BE:9E

UPDATE - FOUND A FIX!

It seems to be a problem with locale, I switched my locale to US and now keytool works correctly inside Unity!

Could you send me the cmd lines invoked by Unity when it:

  1. creates the keystore.
  2. adds a new keyalias to the store.

So I can find where the issue is and pass the info fou you guys to fix? Or maybe Oracle :slight_smile:

Thx a lot

The problem is with keytool.exe when used to obtain info from a keystore.
keytool -list … fails in my locale.
I will report it to Oracle.

Thanks a lot!

Hi guys it’s really some java problem, I’ve downgraded the Java SDK to 6.14 and it worked normally. I was able to create a new key, and use a existent key

Hi guys from this link you can get older versions of Java SDK
http://www.oracle.com/technetwork/java/archive-139210.html

I’ve checked that in version 6.14 it worked normally, can some one check wich version the keytool stop working?

I could not get Unity to create a keystore, it always said failed to find Java SDK. I made sure that I had the corrent PATH set in my windows environment variables but it still says this. So I ran the keytool from my command prompt and created a keystore. What happens now? I have selected “Use existing keystore” and selected the keystore by pressing Browse Keystore. Is this correct? Or do I have to sign the .apk manually as described on the android developer site because I didn’t use Unity to generate it? I would rather use Unity if anyone can give me some ideas on how to get it to find my Java SDK.

hi,

this is my step by step ::.

http://forum.unity3d.com/threads/62137-Android-Signing

I’m having the same problem, did you find a solution?

Turns out I just needed to use the 32 bit JDK… not the 64 bit JDK… so there’s an extra trouble shooting tip for the forums :slight_smile:

there is no new key option showing up in the key Alias option after checking the create keystore and entering same password twice.

Same problem for me… no “Create New Key” option in Alias.

I just had this problem and, for me, the solution was that I was “Working Offline”. I signed into my Unity account and was then able to see and select my key.

Enter correct Sdk path and Jdk path in the preference field… keystore alias will get linked up automatically