3

Hello when i try to log to my app suddenly i got this error:

Login Error: There is an error in logging you into this application. please try again later

anyone knows what's wrong and how to fix it?

user3253375
  • 57
  • 1
  • 2
  • 8

5 Answers5

7

I just solved this problem with an easy fix.

Connect your phone through usb debugging to see logcat , open your app and while initializing, logcat shows the hashkey. just filter "hash" and you will get the key. Then replace the one in facebook developer console.

firativerson
  • 315
  • 1
  • 2
  • 14
4

I have also faced same problem. But I resolved like this. From your

Facebook Account Settings --> Apps --> Logged in with Facebook --> select your app and remove.

Now try to login this error has gone

EDIT

I think you using "LoginManager.getInstance().logOut();" When logging out your application. When try to login again with Facebook it gives that error because you already authenticated the App. So don't need to use re authenticate again and again. Or you have to remove the user authentication each time(This is not a good practice)

AccessToken accessToken = AccessToken.getCurrentAccessToken();
if(accessToken != null) {
  // Perform your app login If you want do any action? you can call newMeRequest with access token
 GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(JSONObject object, GraphResponse response) {
                    if(null != object) {
                        try {
                            String fbId = String.valueOf(object.optString("id"));
                            String name = object.optString("name");
                            String profileImageUrl =  object.getJSONObject("picture").getJSONObject("data").getString("url");                                
                           // launch your home screen with passing required data from facebook object (or) you can save in shared preference 
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    } else {
                        // call your authentication process
                    }
                }


            });
   } else {
    // call your authentication process
   }
Naveen Kumar M
  • 6,868
  • 6
  • 55
  • 66
  • 1
    tried that too...and reset the keyhash by deleting old one and generating new one. saved it to the facebook developer console, still getting same error. – Ibrahim Gharyali Aug 19 '16 at 09:20
1

You are getting this error because the Keyhash associated with developer or release signature is missing in your app's facebook developer account.

To get the Keyhash please follow the below mentioned link and the simplest method would be generating through code.

Facebook Android Generate Key Hash

once it get generated then you can update the same .

  1. open your app in facebook developer's account
  2. go to settings
  3. add the generated KeyHash in KeyHash field.

Hope it wil work for you!!!!!!!

Community
  • 1
  • 1
0

Try once by generating Keyhash programatically instead of openssl . Steps to generate Keyhash programatically i have already mentioned in my previous answer.

0

I was getting the same issue but somehow this solution works for me and may be can save your time too.

Please follow the below steps

Go to setup menu in your Google Play Console Select App Signing(refer below image) play console

You must be seeing SHA1 key in hex format App signing certificate. Copy the SHA1 in hex format and convert it in to base64 format and you will get something like this: anoopghildiyal=

Now Go to Facebook developer console and add the above key(anoopghildiyal=) in the settings —> basic –> key hashes.

anoopbryan2
  • 751
  • 9
  • 17