Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Alias does not show up in Publishing Settings

Discussion in 'Android' started by zugzwang, Jan 12, 2011.

  1. zugzwang

    zugzwang

    Joined:
    Jan 12, 2011
    Posts:
    24
    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.
     
  2. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    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?
     
  3. zugzwang

    zugzwang

    Joined:
    Jan 12, 2011
    Posts:
    24
    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.
     
  4. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    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
    Code (csharp):
    1. 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?
     
  5. zugzwang

    zugzwang

    Joined:
    Jan 12, 2011
    Posts:
    24
    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:D7:39:22:90:4C:1B:3A:C3:FD:DA: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 :)

    Thx a lot
     
    Last edited: Jan 13, 2011
  6. zugzwang

    zugzwang

    Joined:
    Jan 12, 2011
    Posts:
    24
    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!
     
  7. leonardoaraujo

    leonardoaraujo

    Joined:
    Jun 3, 2010
    Posts:
    87
    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
     
  8. leonardoaraujo

    leonardoaraujo

    Joined:
    Jun 3, 2010
    Posts:
    87
  9. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    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.
     
  10. gamestudio

    gamestudio

    Joined:
    Mar 10, 2010
    Posts:
    27
  11. earthcrosser

    earthcrosser

    Joined:
    Oct 13, 2010
    Posts:
    121
    I'm having the same problem, did you find a solution?
     
  12. earthcrosser

    earthcrosser

    Joined:
    Oct 13, 2010
    Posts:
    121
    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 :)
     
  13. Asbesto

    Asbesto

    Joined:
    Dec 3, 2017
    Posts:
    2
    there is no new key option showing up in the key Alias option after checking the create keystore and entering same password twice.
     
  14. rohandm29

    rohandm29

    Joined:
    Dec 31, 2017
    Posts:
    1
    Same problem for me.. no "Create New Key" option in Alias.
     
  15. unbreakable3D

    unbreakable3D

    Joined:
    Jun 13, 2017
    Posts:
    5
    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.
     
  16. fingersoft

    fingersoft

    Joined:
    Nov 28, 2017
    Posts:
    2
    Enter correct Sdk path and Jdk path in the preference field.. keystore alias will get linked up automatically