问题
The 'Debug Android Key Hash' in the Inspector FaceBookSettings does not work (Windows7) because it uses an incorrect DebugKeyStorePath. This is caused because the drive ("C:\") is not included in the HOMEPATH.
Only System.Environment.GetEnvironmentVariable("HOMEPATH")
is used to build the path, which does not contain the drive. For the full path the System.Environment.GetEnvironmentVariable("HOMEDRIVE")
should be added in front of the path.
Until now I manually fix this after each SDK update by modifying FacebookAndroidUtil.cs:
private static string DebugKeyStorePath
{
get
{
return (Application.platform == RuntimePlatform.WindowsEditor) ?
System.Environment.GetEnvironmentVariable("HOMEDRIVE") + //FIX PATH!!!
System.Environment.GetEnvironmentVariable("HOMEPATH") +
@"\.android\debug.keystore" :
System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) +
@"/.android/debug.keystore";
}
}
I have not checked if it is fixed in SDK 5.1 BETA because the link currently downloads FacebookSDK-140101-beta and not FacebookSDK-140401-beta (probably just a wrong filename, but to be sure I skipped that update for now).
回答1:
This is fixed in Facebook SDK v6.0
来源:https://stackoverflow.com/questions/22881637/incorrect-debugkeystorepath