4

Thanks to all in advance,

I followed this documentation:

and this specific video for facebook integration in Android:

But Unity does not fill (as in the video) "Debug Android Key Hash" field, that i should insert in my facebook app.

A screenshot of the problem

I've installed:

  • Unity 4.2
  • jdk1.7.0_25 (with environment variable Path)
  • all android sdk versions
  • openssl (in C:\openssl)

I tried to create manually the "debug.keystore" file using cmd.exe (Facebook Android Generate Key Hash) with keytool and moved it into "C:\Users\(My UserName)\.android", but Unity does not find that key hash.

Can anyone help me? i'm stuck...

-------------- SOLVED ------------------------

I used this solution Facebook Android Generate Key Hash to create a debug.keystore, moved to "C:\Users\(My UserName)\.android" and used this key on facebook

Community
  • 1
  • 1
RevoLab
  • 480
  • 1
  • 5
  • 8

3 Answers3

2

The script in the Unity Editor will try to run:

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64

(or the mac equivalent if you are on a mac)

see: https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/

from your command it looks like you should have the key in:

"C:\Users\(My UserName)\.android"

and not

"C:\Users(My UserName).android"

(notice the folders)

or if you have multiple hard drives and don't have your home on your primary drive, then move debug.android to where ever your home variable path points to.

another thing would be to ensure that both keytool and openssl is in your path. you can manually execute them in the shell. If it can't find them then add them to your PATH.

I hope that helps.

Brian Jew
  • 906
  • 5
  • 5
  • Yes, sorry. I wrote the path in the wrong way, but I meant what you said -> "C:\Users\(My UserName)\.android". I solved by manually creating the key via shell. Then i moved the keystore into ".android" folder and used that. I will try to add opensll in PATH environment variable, thank you! – RevoLab Oct 15 '13 at 16:22
  • No problem. If that still doesn't work, there's an alternate solution. Look up the "Troubleshoot" section under step 4 in this page: https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/ It has a way of getting the keyhash directly from the device itself. – Brian Jew Oct 18 '13 at 18:42
  • @brian_jew -- if you see this, hey, it's immensely hard to do this if developing Unity-Mac->Android. Already emailed you in a panic also :) It's an incredible time-waster; there's just some astounding problem with the key hash using Unity on Mac. (Note among other issues: no matter which Unity project I launch on Mac, I just get the SAME key hash in the FB settings .. would that be correct??) – Fattie May 05 '14 at 14:14
0

like this

like this but instead of eventappkey.keystore and the path put the path of debug.keystore then the SHA1 at the bottom is what you use for facebook, and remember to change it when you sign with release keystore

JRowan
  • 6,520
  • 6
  • 34
  • 57
0

You can try creating an empty project in Android Studio (you can delete it later). Doing this generates the required debug.keystore file in "C:\Users\{username}\.android" directory.