Home
android
facebookdevelopers
facebookUnitySDK
Tutorial
unity
Your android debug keystore file is missing [FIX]
 

There must be some other ways to solve this error. But how i solved is simply adding this line of code in FacebookAndroidUtil.cs file

System.Environment.GetEnvironmentVariable("G:\android\android-sdks") + @"\.android\debug.keystore" : 

 
The problem was i had %HOMEPATH% environment variable in other drive(In G:/) and unity project in another drive.
Then whenever Facebook SDK calls System.IO.File.Exists(DebugKeyStorePath), DebugKeyStorePath is actually wrong. That is because DebugKeyStorePath is searching in

System.Environment.GetEnvironmentVariable("HOMEPATH") + @"\.android\debug.keystore"

Which is wrong path to find the key.

Solution

Go to FacebookAndroidUtil.cs file, and on line 62 change the code from

System.Environment.GetEnvironmentVariable("HOMEPATH") + @"\.android\debug.keystore" : 

To

System.Environment.GetEnvironmentVariable("G:\android\android-sdks") + System.Environment.GetEnvironmentVariable("G:\android\android-sdks") + @"\.android\debug.keystore" :
Change G:\android\android-sdks to you android sdk path.

Now its working fine and i got my keyhash in Facebook settings. I hope this will work for you too.




Any Problem? Feel free to say in comments.

Blog authors

3 comments

  1. BilgiKirliliÄŸi
    BilgiKirliliÄŸi
    August 23, 2023 at 7:33 AM
    C:\Users\username\.android
  2. Alyen siker
    Alyen siker
    August 19, 2016 at 4:08 AM
    Where is the file?
  3. dandesz198
    dandesz198
    July 9, 2016 at 1:03 AM
    The line 62 is:
    setupError = ErrorNoKeystore;
    But the line 98 contains what you writed.
    Changing code, saving code, and closing then reopening Unity isn't solved my problem.