App is misconfigured for Facebook login: Android F

2019-01-01 15:19发布

I have integrated my application with Facebook, and for this I am using Facebook's Graph API. I am retrieving profile and friends information. It is working fine on my device which has Android 2.3 (Gingerbread), but recently my client has faced an issue while he is trying to connect to Facebook through my app. He has Android 4.0 (Ice Cream Sandwich) on his device. When he clicks a button on the app that takes him to the Facebook login screen, after login he gets a message:

My app is misconfigured for Facebook login. Press Okay to go back to the application without connecting to Facebook.

Facebook error message

I am not getting what is the problem whether it is related to Android version or what.

How can I fix this problem?

18条回答
梦寄多情
2楼-- · 2019-01-01 15:28

I faced the same problem, after spending 24 hours and a lot of search we use this method to solve my problem.

  1. Check your Xcode project current bundle identifier for example : com.yourcompanyname.yourappname

  2. use the same com.yourcompanyname.yourappname bundle identifier for creating app in Facebook see attachment.

enter image description here

查看更多
何处买醉
3楼-- · 2019-01-01 15:28

I had this problem just a few minutes ago myself on 4.0.4 and it seems to have resolved itself.

查看更多
孤独寂梦人
4楼-- · 2019-01-01 15:30

The answer from Jesse Chen is fine. Facebooks SDK works fine, don't break it.

I again ran into this problem and found out that the Facebook SDK documentation is corrected and is very fine now. Now it is guiding how to debug and release hash keys can be set; just do as it says.

Below is my old story. There is missing that you can set two hash keys, one for debugging and one for signed, released application for the old Play Store.


I found out that problem was in my case in the Facebook SDK's documentation. It guided us to use the debug key hash and put it in Facebook's app configuration. Hash is guided to get this way:

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

This works fine, when you are dubugging or running application from Eclipse.

But, if you publish your application to Andoid Play, you must use your own publisher key to export the signed .apk file. With that .apk, the hash in the Facebook app console is not valid any more! You must get a hash for the developer key like this:

keytool -exportcert -alias <developer alias> -keystore ~/.android/<developer keystore> | openssl sha1 -binary | openssl base64

And put it in the Android Key Hash in the Facebook app console for your published application. After that, SSO works fine again for your signed .apk file.

查看更多
一个人的天荒地老
5楼-- · 2019-01-01 15:33

I just had the same problem and the solution turned out to be super simple. When I created the app in the dashboard, I only had added the key hash for the android debug keystore. This all works fine if you install the app as a developer via a USB cable in this case.

Once you have an app in the Play Store, you will use a production key to sign the app. This also means, that you have to get the key hash of the production key like for the debug key and add it as a second hash to the list of native app hashes.

just to remember you how the key hash works: keytool -exportcert -alias -keystore ~/keys/android_keystore | openssl sha1 -binary | openssl base64

Hope that helps!

查看更多
临风纵饮
6楼-- · 2019-01-01 15:36

Also encountered this issue.

Simply go to the Facebook developers getting started page here

and follow step 4 - the thing with the command line.

Worked for me.

Enjoy.

查看更多
ら面具成の殇う
7楼-- · 2019-01-01 15:37

When you create the key hash, you might end up with something which has the equality sign "=" at the end, like ga0RGNYHvNM5d0SLGQfpQWAPGJ8=. While Facebook gladly accepts the equality sign as part of the key hash, you have to remove it in order for it to work.

Additionally, check out the accepted answer to Android Facebook SDK 3.0 gives "remote_app_id does not match stored id" while logging in: when getting the key hash for the debug keystore, use the password "android". Otherwise the key hash will be incorrect and you will get the error specified in the question (be nice and vote up the answer there if it helped you.)

查看更多
登录 后发表回答