can't create the right hash key

I have went threw all the steps, creating a key hash for android for my game build in corona. For 2 days I’m trying to figure it out and it just doesn’t work. Feelling kinda desperate. :frowning: Here are my steps:

I have downloaded OPENSSL from Google in extracted it into C:\openssl I have the latest version of Java which is in C:\Program Files\Java\jre7\bin For testing I’m using the sample Facebook app provided with Corona. I have entered the AppId. I create the keyhash using this command:

keytool -exportcert -alias androiddebugkey -keystore “C:\Users\tomaz.OXYLUS.android\debug.key store” | “C:\OpenSSL\bin\openssl” sha1 -binary | “C:\OpenSSL\bin\openssl” base64

for password I enter android

then I paste the generated key in my facebook developer account under Native Android App\ Key Hashes

then I try to connect with the Corona Facebook app to Facebook, but it always says “loginCancelled”. Also this error appears in the terminal window: W/fb4a:fb:OrcaServiceQueue(29191): com.facebook.orca.protocol.base.ApiExc eption: Key hash EOw2r7Y4bNzFal-wFxLBGJQSxV8 does not match any stored key hashes.

What am I missing? I also tryed this procedure with the original game key. No succes. Please help.

I use these steps and I have never run into a problem.

I suspect it’s the space between debug.key and store that’s causing your problem.  Keytool is likely not outputing a valid key and the next two commands on the pipleline (the two openssl commands) are just taking whatever input and spewing it out.

You also have to build your app with the keystore you’re creating.  If you are using a keyalias of “androiddebugkey” and a keystore of “debug.keystore” in Corona SDK you are likely using the one that ships with Corona SDK.   Before you can build a hash of the key, it has to be a key that exits.

Can you do a directory of your C:\Users\tomaz.OXYLUS.android\ folder and see if there is a file in there that’s your keystore?

Rob

I have also tryed with the release key, using this command. I saw in my previous post there were some mispelling. I apologize for that. Here is the code for the release key and folder screenshot. I’m running this code in C:\Program Files\Java\jre7\bin> and still with no success. :frowning:

keytool -exportcert -alias furiousclimber -keystore “C:\tomaz\development\lua\keys\furiousclimber.keystore” | “C:\OpenSSL\bin\openssl” sha1 -binary | “C:\OpenSSL\bin\openssl” base64

folder.GIF

When you build for android are you telling it to use your furiousclimber keystore?  Or are you still using a debug keystore?  Your app has to match.  Also when you run that command line command, what you get output should match EOw2r7Y4bNzFal-wFxLBGJQSxV8 give or take a couple of symbols like the = on the end.   When all three are in sync, (what you see in that command, what you have on facebook and having Corona SDK build with that keystore) then things will work.

You can also leave everything starting at the first | off and make sure you get a really long block of random text.  If you get anything else like an error message, there is a problem with keytool reading that keystore, like a wrong password.

Rob

Thank you Rob for all your efforts. I’m using the furiousclimber keystore. I have tryed also your suggestion and entered only keytool -exportcert -alias furiousclimber -keystore C:\tomaz\development\lua\keys\furiousclimber.keystore

After entering the password, the computer beeped a couple of times and some random characters with my name and address showed up. Does this mean, there is problem with OpenSSL then?

Could I try also this http://stackoverflow.com/questions/16730848/facebook-integration-in-android-application/16734424#16734424 solution in Corona somehow?

Hi Rob,

thank you again. I solved it. I used this version of OpenSSL http://slproweb.com/products/Win32OpenSSL.html and now it is working just fine. 

I use these steps and I have never run into a problem.

I suspect it’s the space between debug.key and store that’s causing your problem.  Keytool is likely not outputing a valid key and the next two commands on the pipleline (the two openssl commands) are just taking whatever input and spewing it out.

You also have to build your app with the keystore you’re creating.  If you are using a keyalias of “androiddebugkey” and a keystore of “debug.keystore” in Corona SDK you are likely using the one that ships with Corona SDK.   Before you can build a hash of the key, it has to be a key that exits.

Can you do a directory of your C:\Users\tomaz.OXYLUS.android\ folder and see if there is a file in there that’s your keystore?

Rob

I have also tryed with the release key, using this command. I saw in my previous post there were some mispelling. I apologize for that. Here is the code for the release key and folder screenshot. I’m running this code in C:\Program Files\Java\jre7\bin> and still with no success. :frowning:

keytool -exportcert -alias furiousclimber -keystore “C:\tomaz\development\lua\keys\furiousclimber.keystore” | “C:\OpenSSL\bin\openssl” sha1 -binary | “C:\OpenSSL\bin\openssl” base64

folder.GIF

When you build for android are you telling it to use your furiousclimber keystore?  Or are you still using a debug keystore?  Your app has to match.  Also when you run that command line command, what you get output should match EOw2r7Y4bNzFal-wFxLBGJQSxV8 give or take a couple of symbols like the = on the end.   When all three are in sync, (what you see in that command, what you have on facebook and having Corona SDK build with that keystore) then things will work.

You can also leave everything starting at the first | off and make sure you get a really long block of random text.  If you get anything else like an error message, there is a problem with keytool reading that keystore, like a wrong password.

Rob

Thank you Rob for all your efforts. I’m using the furiousclimber keystore. I have tryed also your suggestion and entered only keytool -exportcert -alias furiousclimber -keystore C:\tomaz\development\lua\keys\furiousclimber.keystore

After entering the password, the computer beeped a couple of times and some random characters with my name and address showed up. Does this mean, there is problem with OpenSSL then?

Could I try also this http://stackoverflow.com/questions/16730848/facebook-integration-in-android-application/16734424#16734424 solution in Corona somehow?

Hi Rob,

thank you again. I solved it. I used this version of OpenSSL http://slproweb.com/products/Win32OpenSSL.html and now it is working just fine. 

^ indeed the one on top was the best answer. just needed to installed the correct openssl

^ indeed the one on top was the best answer. just needed to installed the correct openssl