In the Facebook android tutorial we are told to use following code to create a key hash:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
Is this the exact code to use in all situations? For example instead of ~/.android/debug.keystore
should it something like C:/folderone/foldertwo/.android/debug.keystore
?
As you can see I'm unsure of whether inverted commas are required or not, whether full paths are required or not!
Is anyone able to provide a real world example?
See
https://developers.facebook.com/docs/mobile/android/build/#sso
One brute force option is to just go ahead and try to share something from your app. My app then displays a Facebook page with the key it is trying to match. Then you can just copy this key and put it in your Facebook 'Settings' page on your developer Facebook account.
Not ideal, but in a pinch it may be helpful.
When having the error in the log, when trying to login to Facebook, look for something that looks like:
where "***" is the key that you need to use.
try
in your main Activity :-) This is the only solution it works for me for Android SDK 3.0
keytool -exportcert -alias androiddebugkey -keystore "debug.keystore path" | openssl sha1 -binary | openssl base64
if you haven't setup environment variables for open ssl and java sdk than put jdk's bin folder path in place of keytool and your openssl path in place of openssl and not to forget to put double quotes for your path
ex-"C:\Program Files\Java\jdk1.5.0_11\bin" -exportcert -alias androiddebugkey -keystore "C:\Users\amin.android\debug.keystore" | "F:\openssl\binsha1\openssl.exe" -binary | "F:\openssl\binsha1\openssl.exe" base64
In eclipse, window -> preferences -> Android -> build -> default debug keystore, copy the path to replace the
~/.android/debug.keystore
I had the same problem, I spend a couple of hours to find a solution, but actually the Facebook SDK provides the solution by itself.
in the DialogListener class I modified the onFacebookError method:
Execute the app (which was sign with the same key i use for the market), and on LogCat will be a message under this tag with the correct key.
We had also created a simple project which does all the work, and returns the correct key on an alert-box and on LogCat. You can find it on our blog.