Unity Facebook SDK - Android Deployement - Key Hash ?

Hi everyone, hope I m not in the wrong spot of the forum for this thread !
Any ways, I got an issue to set up the latest version of the Unity Facebook SDK released, the 4.2.1
(build version 130912.80d74183e6e5bd9)

The problem that I m blocked at the app config step, following the documentation on facebook developer pages, it says that the SDK should be printing up the Key Hash for my app so I just have to copy / paste it the the facebook app config edition. But actually the Facebook Settings tool in Unity doesn’t show up any key hash (nothing appears in front of Debug Android Key Hash), the app name and app ID are there, as much as the package and class name !

I have a feeling that I m missing something stupid out there but after 3 hours trying to find any hint somewhere, … I m just stuck.

Any help please ?

I had the same problem and did the following:

I downloaded the Openssl here, extract the archive, put the content of bin folder in C:\Program Files\Java\jdk1.7.0_06\bin (or your Java SDK Folder) and execute the following command in cmd:

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | C:\Program Files\Java\jdk1.7.0_06\bin\openssl.exe sha1 -binary | C:\Program Files\Java\jdk1.7.0_06\bin\openssl.exe base64

You need to enter password, is android.

After that, i reopenned the Facebook Editor settings and the Debug Hash Key appears.

If anyone is wondering how to add the “system variables” on a windows 7 system.

Computer > System Properties > Advanced System Settings > (you should be on the advanced tab of the system properties window now) Environment Variables:

From here double click the “Path” variable in the system variables list and add your paths to the end of the “variable values” separated with a semi-colon like so:

... ;C:\OpenSSL\bin;C:\Program Files\Java\jdk1.7.0_51\bin

Hope it helps

Actually, the following solution is too much easier than all the other ones:

Just download OpenSSL, extract its content to (e.g. C:\OpenSSL)
(for 64 bit machine, ownload openssl-0.9.8e X64)

Add both the bin directories of OpenSSL and Java JDK to the system variables and Unity/FacebookSDK will do all the work for you and you will get the Android key Hash!!

Simple, no? :slight_smile:

This took me 3 hours to work out, even after reading heaps of post of how to get it to work. First of all download openSSL at the time of writing you should be getting v1.01g or higher. Extract the files and move the contents of the bin folder to the bin folder of your java installation.

Set up the environmental of Path to

“C:\Windows\System32;E:\Program Files\Java\jdk1.7.0_45\bin” (Make sure there are no extra spaces)

You need to put system32 into the Path as you have choosen to place files there during OpenSSL installation.

Now go to command prompt to see if the paths have been done correctly the following should work/still work.

type “Keytool”
then type “OpenSSL”

Now exit command prompt

If you have executed an android eclipse project you should now have a dubug key file located @ C:\Users\[UserName]\.android called “debug.keystore”

Also make sure that unity project is in the same folder as the debug keystore or make changes to the facebook api as mentioned by other post. You might be able to create a fake folder to hold the debug keystore file, if you are unable to move to project to the keystore location.

I have same problem.after spending 2 days i got this solution.

If you using facebook unity plugin than go to"Assets->Facebook->Editor->android" and open FacebookAndroidUtil.cs.

In above script just replace line number 70 with below line
“var arguments = @”““keytool -storepass {0} -keypass {1} -exportcert -alias {2} -keystore {3} | openssl md5 -binary | openssl base64"””;"

this is work fine for me.

Perhaps you need to create a new keystore.

to do so:

In the Build Settings - Player Settings

check create new keystore

click “browse keystore”

select a path/destination for your keystore file to be stored

enter password and retype

In the “key” menu, click on Unsigned(debug) and click “create new”

fill in the info in the pop-up screen - fill in the alias

In the “key” menu, click on Unsigned(debug) and select the alias you used and enter the password once more under the alias

Hey guys i found this on git hub its work for me after a month of looking for help but nothing really work, this guy do a custom fix for all version of the sdk hope it work for you sorry for my english: https://github.com/44GameStudio/Facebook-Unity-Fix

this is full solution of your problem