Search Unity

[Unity 2020.1.0a17] Android build error "Cannot recover key".

Discussion in 'Android' started by sama-van, Jan 9, 2020.

  1. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    First of all if I use the default debug keystore there is no issue at all.
    Using the In app purchase 2.0.6 and Analytic 3.4.0.
    Everything was working fine until I import & activate those 2 packages.

    Making my own key with a password form such as Xxx@xxxx9999.
    If I do not input both password in fields from the PublishingSettings or use a wrong one , I go a straight wrong password message from the console which is a good new and means the password I am using for build is the correct one... (well should be).

    On build, the entire process goes fine until it reach something named "Gradle" which fails.
    A 91 errors stack shows up in the Console and the first which could make senses is :

    But well as explain first, password is apparently ok from Unity...

    Anyway, that's a bit weird, no idea what to do.
    Did some search about the Gradle thing and version + location are :
    Below more screenshoots as well.

    Thank you for your assistance!

    (Already sent the entire project and screenshots to the ReportBug section)

    UnityBuildBox_01.JPG UnityBuildBox_012.JPG UnityBuildErrorConsole_01.JPG UnityInAppPurchaseSettings_01.JPG UnityInPublishingSettings_01.JPG
     
  2. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Alright then removed the @ character from the password and it now works.

    Could be a smart move to add a @ detection from the Unity NewKeystore generator if detected from password input ;)
     
  3. DungDajHjep

    DungDajHjep

    Joined:
    Mar 25, 2015
    Posts:
    202
    lol, thanks you
     
  4. blobface

    blobface

    Joined:
    Mar 6, 2019
    Posts:
    12
    2019.3.5f1 here, just had this error for the first time after maybe 50 successful Android builds from the same project with @ in the password, this is the first time I've seen such an error. After a brief panic, I simple hit build again and it worked without having to change the password... I should look into changing the password in any case.
     
  5. jeanf_le

    jeanf_le

    Joined:
    Jul 28, 2014
    Posts:
    11
    removing the .android folder from : C:\Users\%USER%\.android worked from me.
    I had to go to the taskManaer and close OpenJDK though.
     
  6. Yokimato

    Yokimato

    Joined:
    Oct 9, 2012
    Posts:
    9
    Sorry to necro this thread, but worth calling out that more symbols beyond the @ symbol will cause issue. Both
    Code (CSharp):
    1. *
    or
    Code (CSharp):
    1. #
    caused this same head-scratching issue, given the error message. Easy feature request to remove this confusion from the KeyManager integration Unity has.
     
    sama-van likes this.