I have a problem when I want to publish my android application with facebook integrated. I signed my app with eclipse, and used "keytool -exportcert -alias androidreleasekey -keystore MyReleaseKeystore.keystore | openssl sha1 -binary | openssl base64" in terminal to generate a release key, and I added in "Native Android App" configuration. If I try to log in fb via application I received dialog with nothing.
The path to keystore file is correct because keytool asked me for password.
I used the same keystore to sign apk in eclipse and to generate fb hash. Password is correct.
I copied generated hash to fb developer console.
When I tested with debugkey, all work fine. I had a problem with hash in debug mode but I could have turn on debugging in facebook sdk Util class and check in logcat the correct hash but in release apk this trick did not work (I could not see any error).
Could anyone help me?
Check your alias in "-alias androidreleasekey" is the same with the alias you generated in ReleaseKeyStore.keystore
Related
I am developing an Android application, where I am using a Facebook login button.
Firstly I have created Signed release APK from an Android studio and created new keystore. Then I tried to create Release Key Hash for my application, with OpenSSL. That's the command I have used:
keytool -exportcert -alias facebook -keystore ...\keystore.jks | D:\openssl-0.9.8e_X64\bin\openssl.exe sha1 -binary | D:\openssl-0.9.8e_X64\bin\openssl.exe base64
Afterwards, I was asked for a password, here I have provided the password that I have generated when creating Signed release APK.
I copy the key, that was provided from the console and copied it to Key hashes input in facebook console.
However, whenever I try to use facebook login, I got the error:
Invalid key hash. The kay hash ...... does not match any stored hashes...
If I copy the key that is provided in error to facebook console, it works as it should, but I don't want to do that for each person that will use my application, do I?
Thanks for your help!
I faced the same issue and was able to fix it by following instructions from Why keytool is generating different facebook androiddebugkey hash?
Also I had missed to set the my application's status from development to live in Facebook console.
I am finishing an app that uses the Android Facebook SDK, in order to login with Facebook. My app must be configured with the proper generated key hash, that must exist on my computer and that must also be set into my Facebook developper console.
When I print the current key hash from my Android app, using the piece of code found on other similary stackoverflow posts, it logs me an old keyhash that I used by the past into my Facebook Developper console. It may be the debug keyhash.
Now I try to generate a release keyhash with the keytool command.
As I am working on a Mac :
keytool -exportcert -alias MyReleaseKey -keystore ~/.android/myreleasekey.keystore | openssl sha1 -binary | openssl base64
I tried almost everything, but this command never asks me for a password, and the file is never generated. Some people says that if it isn't asking for a password, then the entered path may be invalid.
So, I tried all paths, and all the things I could find on internet, such as deleting the ~/.android/debug.keystore which is generated by Android studio. Nothing works...
Why can't I generate my release keyhash ?
Does it have to be stored into the ~/.android/ folder ?
I know that when generating the debug keyhash, we must enter the "android" password as the keystore password. Can I enter the password I want for the release keystore ?
and the file is never generated.
Why do you expect a file to be generated? That command is simply supposed to output a string you then paste into the Facebook dev console.
How do you generate your release APK? Look into app/build.gradle or go to Build -> Generate Signed APK inside of Android Studio and look for the path of your keystore file (it could end with .keystore or .jks).
For now, simplify the command to generate the APK until you're certain you've found the path. Using only
keytool -exportcert -alias MyReleaseKey -keystore ~/.android/myreleasekey.keystore
won't mask any errors, and tell you exactly what's wrong.
I have a problem with my app facebook key hashes on release build.
I have generated release key hash from keystore file with this command:
keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64
and pasted it to developers.facebook page. However, when I try to login, it says that key hash which is shown doesn't match any of listed in developers page. If I paste that shown key hash, facebook login will work, but I want facebook to work for other users without putting their key hashes to developer page.
How could I do that?
You have to make your app public for other devices to work.
Go to your facebook developer console and select your project(app) from app section.Then in status and review turn on the option--Do you want to make this app and all its live features available to the general public?.
You will need an email id to turn it on so add one if you haven't already.
an apology, actually I speak Spanish, and my English is very basic, I'm using Google translator, I hope you understand me.
I have an application that connects to the Facebook sdk, I've created my key hash using the example of Facebook, also I created a hash key using my keystore signed by the apk, and also I have that gives you using the Log.
The problem is when I run the application with the device connected to my pc, it gives me login to facebook without problems, but when I export the. Apk to test it on another device does not open the connection to facebook, just do not start session, I hope you can help me.
You Have to generate release key for facebook and add it on Facebook App developer console for that apps
Follow Below Steps:
Download openssl-for-windows from here
Now Open command propmpt(admin recommanded) provide jdk path .
C:\Windows\system32>cd "C:\Program Files\Java\jdk1.8.0_20\bin"
Use below command for generating key hash. You need path to release keystore and openssl bin.
keytool -exportcert -alias "enter alias name" -keystore "D:\mysapp.keystore" | "E:\Projects\facebook-android-sdk-3.6\openssl-0.9.8k_X64\bin\openssl" sha1 -binary | "E:\Projects\facebook-android-sdk-3.6\openssl-0.9.8k_X64\bin\openssl" base64
Enter release keystore password.
Enter Generated key in facebook app console.
Try this way for generating your key. If it is not work , try to generate your Facebook key by using your release key not your debug key. Hope this helps.
keytool -exportcert -alias mykeystore -keystore mykeystore| openssl sha1 -binary | openssl base64
hello, I am using the above command to generate my facebook key hash. It asks for my password and gives me a key hash. I put this key hash in the facebook app settings, yet it does not work for my signed android app.
When I was debugging the android app, I saw the console message saying it didn't recognize "android key hash blahblahblah" so I copied "blahblahblah" into the facebook app, and that worked - my android app was able to use the facebook stuff while in debug mode. But clearly that was only for the debug keystore. Now for the real keystore the one it generates is still wrong, so a production version of my app will not be able to use facebook api.
One thing about my keystore is that it was made in eclipse. It is one keystore with two keys in it. I have noticed that eclipse keystore acts different than command line keystore things, and that they are incompatible for signing things. Yet I have already released a version of my app so I need to make due with the keys I am already using.
Insight appreciated.
Use keytool -list to list the aliases you have. If you are not sure which one you used to sign the APK you released, try both. One should work.
I had this same problem - debug hash key worked but production key did not. I ended up installing OpenSSL from a different source than I originally installed, re-created the hash key, and it fixed the problem. This is the site where I got OpenSSL that worked: http://gnuwin32.sourceforge.net/packages/openssl.htm.
If running Cygwin on Windows, use cygpath to find the keystore:
keytool -exportcert -alias androiddebugkey -keystore $(cygpath -aw ~/.android/debug.keystore) | openssl sha1 -binary | openssl base64 Keystore-Kennwort eingeben: android
If using /cygpath/c/Users/name/... it will not work.