Search code examples
c#unity-game-engine

Whatever I do always get error : Keystore file exists but is empty In Unity


I have browsers with so many threads and postings about "Keystore file exist But is empty", but i can't find a really suitable question and answer match with mine in Unity.

I want to generate a release hash key for login with facebook using facebook sdk 7.9. Since the debug in editor login ran successfully. The problem is when running on the device.

Then I have found a thread that teaches how to show all keystores with an alias.

Below is how to do it :

  1. Open CMD
  2. Use Command : "keytool -list -keystore "PATH YOUR KEYSTORE"
  3. Enter

In this "PATH YOUR KEYSTORE" change with your path ex:

c:\unity_project\TTS\mykey

But what I get does not always reveal the keystore and the alias. What i get is an error:

keytool error: java.lang.Exception: Keystore file exists, 
but is empty: c:\unity_project\TTS\mykey

Why do I always got this error?

I have already created a keystore and the keystore is saved in this path:

 c:\unity_project\TTS\mykey

I have also created a key from the keystore. This can be created with the build setting:

[![enter image description here][1]][1]

[1]: https://i.sstatic.net/Glim2.png

Then I have built it without check "Development Build".

So why do I always get the above error? Is it because I need to generate a release hash key for that keystore alias key.

Thanks

Dennis


Solution

  • Finally i got the solution myself.

    There is a little mistake I make. add FileName at the end of -keystore parameter value.

    We need to specifiy the keystore file location like this is path \ tts.keystore file. So how to reveal keystore and alias using cmd in my case just type :

    c:\unity_project\TTS> keytool -list -keystore c:\unity_project\TTS\tts.keystore