<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: IceTrooper</title>
    <description>The latest articles on DEV Community by IceTrooper (@icetrooper).</description>
    <link>https://dev.to/icetrooper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F329095%2Fe4728dd3-2ad7-45a3-b2f2-1bc4c7ff68d1.jpeg</url>
      <title>DEV Community: IceTrooper</title>
      <link>https://dev.to/icetrooper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/icetrooper"/>
    <language>en</language>
    <item>
      <title>Don't use non-alphanumeric characters in Unity Keystore/Key password</title>
      <dc:creator>IceTrooper</dc:creator>
      <pubDate>Sat, 19 Sep 2020 17:35:38 +0000</pubDate>
      <link>https://dev.to/icetrooper/don-t-use-non-alphanumeric-characters-in-unity-keystore-key-password-1e6l</link>
      <guid>https://dev.to/icetrooper/don-t-use-non-alphanumeric-characters-in-unity-keystore-key-password-1e6l</guid>
      <description>&lt;h1&gt;
  
  
  Short note for Unity developers:
&lt;/h1&gt;

&lt;p&gt;When I was trying to build my game for Android device with Google Play services used I got an error in a Unity console window. The error message looked really generic and I didn't know what I did wrong. Sometime later, I finally found a solution. Looks like non-alphanumeric characters in keystore/key passwords were the problem even that Unity doesn't tell you can't use them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Possible errors:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key somegame from store "C:\Users\SomeUser\Documents\somekeystore.keystore": Cannot recover key&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix
&lt;/h3&gt;

&lt;p&gt;Don't use non-alphanumeric characters in passwords when publishing a game to Android devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  First found solution:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://forum.unity.com/threads/unity-2020-1-0a17-android-build-error-cannot-recover-key.806148/"&gt;Unity forum thread&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alright then removed the @ character from the password and it now works.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How can you change password?
&lt;/h3&gt;

&lt;p&gt;If you want to change keystore password follow those steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Locate &lt;code&gt;C:\Program Files\Java\jdk1.8.0_202\bin&lt;/code&gt; to use keytool and open powershell there.&lt;/li&gt;
&lt;li&gt;Type command: &lt;code&gt;./keytool -storepasswd -new [newpassword] -keystore [filename.keystore]
-storepass [currentpassword]&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to change key password follow those steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Locate &lt;code&gt;C:\Program Files\Java\jdk1.8.0_202\bin&lt;/code&gt; to use keytool and open powershell there.&lt;/li&gt;
&lt;li&gt;Type command: &lt;code&gt;./keytool -keypasswd -alias [keyalias] -keypass [currentpassword] -new [newpassword] -keystore [filename.keystore] -storepass [currentpassword]&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To print keystore and keys infromation:&lt;br&gt;
&lt;code&gt;./keytool -list -v -keystore [filename.keystore]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to pass keystore location, remember to use quotes, example: &lt;code&gt;./keytool -list -v -keystore "C:\Users\SomeUser\Documents\somekeystore.keystore"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://www.ibm.com/support/knowledgecenter/SS4GSP_6.2.4/com.ibm.udeploy.doc/topics/keystore_change_password.html"&gt;IBM support knowledge center&lt;/a&gt;&lt;br&gt;
More keytool commands: &lt;a href="https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html"&gt;Keytool docs&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If I wrote something wrong, don't hesitate to correct me and write a comment. Hope that short note would help someone when publishing to Google Play.&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gradle</category>
      <category>building</category>
      <category>android</category>
    </item>
  </channel>
</rss>
