Android app Key Hash doesn't match any stored key hashes

后端 未结 13 1482
后悔当初
后悔当初 2020-12-02 14:51

I have an application on production on Play Store which uses a login with the Facebook SDK. When I debug the application from Eclipse there is no problem, but when its on pr

相关标签:
13条回答
  • 2020-12-02 14:55

    Enable Single Sign On Enable single sign on for your app by setting Single Sign On to Yes below. please check point no. 9 on https://developers.facebook.com/docs/facebook-login/android

    0 讨论(0)
  • 2020-12-02 14:59

    Simple put the returned error message hash key:

    10-20 22:21:10.752: W/fb4a(:):BlueServiceQueue(5872): com.facebook.http.protocol.ApiException: Key hash VQ3XhZb5_tBH9oGe2WW32DDdNS0 does not match any stored key hashes.
    

    VQ3XhZb5_tBH9oGe2WW32DDdNS0

    On Facebook developers key hashes of your app.

    Hope this help.

    0 讨论(0)
  • 2020-12-02 14:59

    well the actually best and easy way is like this. if you see that problem on your phone screen. You should see that problem with android studio LOGCAT. it will like this

    01-26 14:58:22.885 14851-19534/? W/fb4a.BlueServiceQueue: Exception during service
                                                              X.1xO: [code] 404 [message]: Key hash 961x8mIbWmA7TRRpbk...= does not match any stored key hashes. (404) [extra]: null
                                                                  at X.0fG.D(:240135)
                                                                  at X.0k8.F(:255078)
                                                                  at X.3gX.EUB(:738232)
                                                                  at X.0fo.handleResponse(:242693)
                                                                  at X.0k5.run(:254998)
                                                                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
                                                                  at X.0NH.run(:187661)
                                                                  at X.0JQ.run(:49671)
                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                  at X.0NM.run(:187873)
                                                                  at java.lang.Thread.run(Thread.java:761)
    

    copy this hash key from logcat which is I had made it private (...) and paste it to your facebook developer page. It will solve your problem immediately. Also be ensure that your released APK's hash key different from the original hash key which is download from google play.

    0 讨论(0)
  • 2020-12-02 15:01

    Well, If u r using Windows use this command in cmd .

    Move to C:\Program Files\Java\jdk1.8.0_25\bin

    keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64

    When generating the hash key you need to use openssl-0.9.8e_X64.zip on windows, you cannot use openssl-0.9.8k_X64.zip

    This is the solution.

    0 讨论(0)
  • 2020-12-02 15:03

    Please follow below method to generate hash key this is suggested by @lucianbase at this page https://github.com/AntonioCuevaUrraco/nativescript-facebook-login/issues/14

    Generate SHA1 key of your app either using android studio or cmd tool. copy it like this CD:A1:EA:A3:5C:5C:68:FB:FA:0A:6B:E5:5A:72:64:DD:26:8D:44:84 and open http://tomeko.net/online_tools/hex_to_base64.php to convert your SHA1 value to base64. This is what Facebook requires get the generated hash " ********************= " and copy the key hash to the facebook app.

    0 讨论(0)
  • 2020-12-02 15:07

    It is a nice question. And there are 2 ways to go about it. What usually happens with us is while integrating Facebook SDK for android, we go on following instructions from the Developer site of facebook.

    But once the app is out in the play-store, we tend to forget a procedure that still is pending. And we end upon same error :

    05-13 14:45:43.882: W/fb4a(:<default>):BlueServiceQueue(25454): Exception during service
    05-13 14:45:43.882: W/fb4a(:<default>):BlueServiceQueue(25454): com.facebook.http.protocol.ApiException: Key hash XXXXXXXXXXXXXX does not match any stored key hashes.
    

    Jus got a checklist for this:

    1) Using debug Key, while developing the App

    The Facebook developer site is quite helpful with this. Just copy paste the code they have in the Getting started page into your command prompt. viz:

    keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
    

    The password to it is android and you will get the debug key following it.

    enter image description here

    2) Generating Debug Key, after signing the application

    Once the application is ready to be uploaded to the Google Play store, we need to sign it using a key, value of which is generated from the key store. Which is explained well by Satheesh in his answer. using :

    keytool -exportcert -alias <Alias Name here> -keystore <Path to keystore> | openssl sha1 -binary | openssl base64
    

    Which gives you a different key, than the debug key.

    enter image description here

    0 讨论(0)
提交回复
热议问题