質問

I know that similar questions have been asked before, and I have reviewed all of the answers suggested, tried lots of different possible solutions, but still no go, so I'm asking my (same) question again...

I'm trying to access FB through a Unity app that I'm developing for Android. I downloaded the FB SDK and did as instructed on the developer website. The problem is that, when in Unity, in Facebook / Edit Settings, the Android Debug Haskey that I'm supposed to copy into the FB developer website is missing.

I tried re-generating a key with keytool and OpenSSL (which are both in my PATH, I made sure of that, too) and pasted it into the FB site, but it still doesn't work (I get an error message which goes : "Your Android setup is not correct. See Settings in Facebook menu. UnityEditor.HostView:OnGUI()"

The thing I don't get is that there WAS (and still is, but I guess it's a different file now that I've ran keytool, etc.) a debug.keystore in my %HOMEPATH%\.android folder, so there seems to be nothing wrong here either.

I restarted Unity many times (each time I tried one of the solutions described in the StackOverflow answers I'd found) to check whether the key would appear : it didn't.

I really am at my wit's end, and do not know anyone proficient enough in Android dev to help me out (I'm just a beginner @ Unity). Does anybody know what I should do / doublecheck to fix that ?

NB : The only solution I have not tried is the one described in Unity : creating and building an empty project in Eclipse. Having never developed natively for Android, I have no idea how this is done...

役に立ちましたか?

解決

Another way is to look at the callback from FB.Login for android. It'll provide the correct keyhash since it's generated from the device itself.

他のヒント

I just posted a solution for the missing hashkey in the Editor, as I need to fix this after each SDK update. In my case it is caused because the DebugKeyStorePath (FacebookAndroidUtil.cs) is incomplete and missing the drive. It can be fixed by adding System.Environment.GetEnvironmentVariable("HOMEDRIVE") in front of the System.Environment.GetEnvironmentVariable("HOMEPATH").

For more details and a code example see: Incorrect DebugKeyStorePath

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top