Keystore issues

I’ve been trying to post an android game onto the Google Play Store, with no such luck. I’ve had many errors through the process but I’d managed to work through them till now. After leaving a page on Unity Answers for a month and a half with no response I thought I’d try here. I’ll just get straight to the point.

I created a Keystore for my game only to find the password I had entered somehow got corrupted, either that or I somehow forgot what I had typed a few seconds prior although I find that unlikely as I already knew how important it was to remember this password. Either way I was shocked and concerned when I couldn’t access my Keystore. I spent some time trying to fix this, either by figuring out what I did to ruin the password, or by creating a new one and found I couldn’t create a new Keystore, getting this error:

Command Invokation Failure: Please Make sure location of the keystore is valid.

I did some research to find why this error message was occurring and so far no luck. I tried to edit unity’s files to reset the keystore, I tried using an external keystore creator, Tried using a new SDK tools. Nothing seems to fix it only make it worse. I’ve been working at this for 2 months now and I’m running short on motivation. Anyone have any ideas?

In Player Settings (Android)->Publishing Settings, there’s a path pointing to keystore, validate that the path is correct.

For the old keystore the path is valid. Keystore explorer told me it got corrupted, maybe when I updated Windows or something…
Anyway I’m getting the same error when I try to make a keystore. Which I find odd since it’s a new keystore so it shouldn’t have trouble finding it’s path because it doesn’t exist yet. The other thing I tried is to make the keystore with Keystore explorer then add the key with unity but the password doesn’t want to carry from one to the other.

I made a short video to document what I am talking about if that helps…

https://www.youtube.com/watch?v=dFe4Ad3G4Zc

Did you try creating keystore via Unity’s Keystore Manager?

Yup that’s what I tried first, when I get the command Invokation failure

Not sure what’s wrong, could you attach Editor.log with the error?

Does this work, or do you want the full .log file?

CommandInvokationFailure: Unable to create keystore. Please make sure the location of the keystore is valid.
C:\Users\comit\OneDrive\Desktop\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -Xmx4096M -Dcom.android.sdkmanager.toolsdir=“C:\Users\comit\OneDrive\Desktop\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools” -Dfile.encoding=UTF8 -jar “C:/Users/comit/OneDrive/Desktop/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\sdktools.jar” -

doesn’t look that it’s full command

Here’s the entire editor Log. There’s alot to go through, I wasn’t sure what exactly you’re looking for

8442602–1119131–Editor Log Full file.txt (161 KB)

It seems your project is placed in another location and your trying to access it via symbolic links?

Consider moving Unity Editor + your project to a different location, don’t use OneDrive in this case.

Yup that worked! Thanks for your help!

Ive got this issue today.
I tried to create a new keystore. But in Unity KeyStore manager pressing AddKey does nothing.
I tried to use existing keystore. But Unity lold me that “Maybe the password is wrong”.
Hours later I found stacktraces in console. :slight_smile:

Stacktrace made by “Create new keystore” functionality - was not helpfull.
It told me something like “CommandInvokationFailure: Unable to create keystore. Please make sure the location of the keystore is valid.” And other non-helpfull info.

but…

Stacktrace made by “Use existing keystore” functionality - told me some helpfull info:
Error: Unable to access jarfile C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\sdktools.jar

I went that way and I didnt find “Tools” directory at all!
So I found unity on my friends computer (there was no problems with using keystores).
And there WAS that folder. I zipped thad folder, transferred to my computer, and unzipped it here.

And now all problems are gone.

I think that sdktools.jar is directly using by Unity while working with keystores. So Please check existance of sdktools.jar and Tools folder.

Sorry for my not-perfect english :slight_smile:

I’m getting this with 2023.1.10f1

I have an existing keystore I had backup, which is set correctly in the player settings and allows me to select keys via the old password.
This is an update to an old app from 2016, so I used the old key. Build with no errors.

Uploaded .aab to Google Play to alpha test but Google says:
To upload an Android App Bundle you must be enrolled in Play App Signing.

So I thought I’d try a new keystore, but I get the following (Full Error log below the fold):

CommandInvokationFailure: Unable to create key in keystore. Please make sure the location and password of the keystore is correct.
D:\Program Files\Unity\2023.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -Xmx4096M -Dcom.android.sdkmanager.toolsdir=“D:\Program Files\Unity\2023.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\6.0” -Dfile.encoding=UTF8 -jar “D:/Program Files/Unity/2023.1.10f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\sdktools.jar” -

The tools directory exists as well as the sdktools.jar but the windows explorer path is
“D:\Program Files\Unity\2023.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\sdktools.jar”

Firstly the whole signing process for upload to Google play is very unlcear and confusing.
Second, I can’t create a new keystore with a freshly installed 2023.1.10f1 which is working fine otherwise building and running to devices (S8 + Tab A7 both tested aok).

Anyone with advice on:

  1. How to fix the keystore issue
  2. A clear guide to properly signing an old updated app now built as a .aab to google play via Unity?

thanks!

Update:
I rebuilt it with a signed keystore (original key) as an apk and successfully uploaded it for internal testing. So that works, but I still have the issues noted above. Google seems really insistant on apps now being aab not apk, and I can’t do that with the current problems I’m having.

Update2: Google let me release an update as an apk and successfully signed by my old keystore. However, they warn they want aab from here on out, but I still have the issues as outlined above.

Any help from Unity would be appreciated in how to resolve this.


Full Error:

CommandInvokationFailure: Unable to create key in keystore. Please make sure the location and password of the keystore is correct.

D:\Program Files\Unity\2023.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -Xmx4096M -Dcom.android.sdkmanager.toolsdir=“D:\Program Files\Unity\2023.1.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\6.0” -Dfile.encoding=UTF8 -jar “D:/Program Files/Unity/2023.1.10f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\sdktools.jar” -

Environment Variables:

[DELETED ENVIRONMENT VARIABLES]
[
stderr[

Exception in thread “main” java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at SDKMain.main(SDKMain.java:63)
Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/cms/CMSObjectIdentifiers
at org.bouncycastle.operator.DefaultSignatureNameFinder.(Unknown Source)
at org.bouncycastle.operator.jcajce.OperatorHelper.(Unknown Source)
at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder.(Unknown Source)
at UnityKeyToolGenKey.(UnityKeyToolGenKey.java:96)
at UnityKeyToolGenKey.main(UnityKeyToolGenKey.java:35)
… 5 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.cms.CMSObjectIdentifiers
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
… 10 more
]
stdout[
]
exit code: 1
UnityEditor.Android.AndroidSDKTools.RunCommand (System.String javaExe, System.String sdkToolsDir, System.String[ ] sdkToolCommand, System.String workingdir, System.String errorMsg, System.Int32 memoryMB) (at <4709dcde0756469fa99c122f81326ca3>:0)
UnityEditor.Android.AndroidSDKTools.RunCommand (UnityEditor.Android.AndroidJavaTools javaTools, System.String[ ] sdkToolCommand, System.String errorMsg) (at <4709dcde0756469fa99c122f81326ca3>:0)
UnityEditor.Android.AndroidSDKTools.CreateKey (UnityEditor.Android.AndroidJavaTools javaTools, System.String keystore, System.String storepass, System.String alias, System.String password, System.String dname, System.Int32 validityInDays) (at <4709dcde0756469fa99c122f81326ca3>:0)
UnityEditor.Android.AndroidKeystoreWindow.CreateKey () (at <4709dcde0756469fa99c122f81326ca3>:0)
UnityEditor.Android.AndroidKeystoreWindow.OnGUI () (at <4709dcde0756469fa99c122f81326ca3>:0)
UnityEditor.HostView.OldOnGUI () (at <8059afc4969f4faea44ce7e8d8dd149e>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.IMGUIContainer.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEvent_DefaultActionAtTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElement (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.MouseEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <4322acfaa54d4517b2ed018dde30cfb9>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at :0)

impssible to create any keystore. i moved the project from external drive to desktop, still no result. does anyone know a solution that works?

Same here. Anybody? Unity?

Surely we’re no the only ones encountering this?
Need to submit a bug report to get some interest?
It’s pretty critical to android deployment!

1 Like

Hey @sonicviz and @juratedesigns ! I can confirm you that the bug has been fixed in version 2023.1.11f1, 2023.2.0b7 and 2023.3.0a4.

Let us know if keystore creation works for you in those versions.

Thanks for reporting this issue!

same

i cannt to able to see my first ever game on playstore even after game is completed about 2 weeks Still no use
if i buiuld without keystores it builds but playconsole says errors

cant use another versons coz it make ttotal game bugs, but i have 2023.2.0b5 but no
use

This problem started for me today out of the blue in version 2023.1.15f1, I tried 2023.1.11f1. No dice. I can’t open my existing keystore, nor can I create a new kjeystore. Same issues and error messages as mentioned above. It’s quite troubling as I need to be able to publish the app to the Google Play store this week.