Login Error: There is an error in logging you into this application. Please try again later
Solution 1
I also Face this problem .Update your key hash on Facebook
Solution 2
The error occurs because of invalid hash key.
We can create Hash key using the below command and update the same here under Settings-> Basic -> Android HashKeys
keytool -exportcert -alias ADD_RELEASE_KEY_ALIASE_HERE -keystore ADD_UR_KEYSTORE_PATH_HERE | openssl sha1 -binary | openssl base64
You can find the Relase Key Alias of your keystore using the below command if needed:
keytool -list -keystore ADD_UR_KEYSTORE_PATH_HERE
I have also experience an issue like by using the above HashKey the login works fine if I install the release APK directly to the device, But when I upload the APK to Play Store and install app from store then it shows the same Login failed error. The fix for this is as follows:
-
Go to Release Management here
-
Select Release Management → App Signing
-
You can see SHA1 key in hex format App signing certificate.
-
Copy the SHA1 in hex format and convert it in to base64 format, you can use this link do that without the SHA1: part of the hex.
-
Go to Facebook developer console and add the key (after convert to base 64) in the
settings → basic → key hashes
Solution 3
ANSWER
Just throwing this out there for people still experiencing this issue. The hash I created through the keytool was somehow incorrect. I fixed it by doing the following:
If you already uploaded your app to the playstore and enabled "app signing by Google Play" there is a solution (at least this worked for me):
- Login into the Google Play Console
- Click on the app you want the hash from
- Now, open the navigation on the left hand side
- Under
Release
clickSetup
>
App integrity
- Under
App signing certificate
copy the SHA-1 certificate fingerprint - Go to http://tomeko.net/online_tools/hex_to_base64.php
- Paste the SHA-1 in the first field
- Copy the text in input field under
Output (base64)
- Now open developer.facebook.com/apps
- Navigate to the dashboard of your app (
My Apps
>
Your App Name
) - On the left side navigate to
Settings
>
Basic
- Paste the Base64 text here under
Key Hashes
That should fix the issue.
UPDATE
The steps above should still fully work.
But if you do not want to paste your key on that website, here is an alternative to step 6,7,8 below:
here's a oneliner Node.js command to do the same:
node -e 'console.log(Buffer.from(process.argv[1].split(":").map(hex => parseInt(hex, 16))).toString("base64"))' '5E:8F:16:06:2E:A3:CD:2C:4A:0D:54:78:76:BA:A6:F3:8C:AB:F6:25'
credits: mifi
Solution 4
solutions are -------------- Set LoginBehavior if you have installed facebook app in your phone loginButton.setLoginBehavior(LoginBehavior.WEB_ONLY);
Solution 5
- Generate .apk file
- open a terminal where .apk file exists
- to keep in your mind that you have to generate two separate SHA1 keys for release and debug. e-g just run following command with debug.apk and release.apk
- run
keytool -list -printcert -jarfile yourapkname.apk
- you will get
MD5: 00:00:A0:00:00:00:72:00:00:B9:00:00:00:3D:00:00
SHA1: 00:00:94:00:67:00:FA:00:4E:00:CE:80:00:1A:00:00:00:00:00:00
SHA256: 00:00:00:34:00:00:00:00:00:00:00:00:00:00:00:00:56:00:F5:00:00:49:00:4A:00:00:00:00:00:00:00:00
- copy SHA1 open http://tomeko.net/online_tools/hex_to_base64.php
- past in Hex string your Key Hash will be in Output (base64)
- copy your Key Hash and add in your App setting on developers.facebook.com
Naveen Kumar M
Senior Solutions Architect ಎಲ್ಲಾದರು ಇರು ಎಂತಾದರು ಇರು ಎಂದೆಂದಿಗು ನೀ ಕನ್ನಡವಾಗಿರು! ಕನ್ನಡವೇ ಸತ್ಯ ಕನ್ನಡವೇ ನಿತ್ಯ.
Updated on July 05, 2022Comments
-
Naveen Kumar M almost 2 years
I am getting this error. When I try to sign in with facebook to my app. When I first time authentication it will correctly working. After I unistalled my application and now trying to sign in with Facebook on that I am getting this error.
Another Issue : After authenticate in device1 and try to login with facebook on device2 also same error is getting.
Solution I Found : when I remove App authentication from Facebook App Settings it is working in above scenario's but this is not an good solution how we can tell to users to do this action?
btnFbLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(accessToken != null) { boolean expires = accessToken.isExpired(); if(!expires) { performFbLoginOrSignUp(accessToken); } } else { LoginButton loginButton = (LoginButton) findViewById(R.id.login_button); callbackManager = CallbackManager.Factory.create(); if (loginButton != null) { loginButton.setReadPermissions("public_profile", "email", "user_friends"); if (CommonUtil.isConnectingToInternet(LoginActivity.this)) { loginButton.performClick(); loginButton.setPressed(true); loginButton.invalidate(); loginButton.registerCallback(callbackManager, mCallBack); loginButton.setPressed(false); loginButton.invalidate(); } } } } });
In Facebook example also having an issue : GitHub link of Facebook example
Steps to reproduce :
Launch the app Login with Facebook Authenticate FB profile.
Un_install the app and install again.
Now try to Login with Facebook.
- The above error will occur. because we already authenticated so need to access fb profile. but here we facing the issue.
- Here already authenticated page is not showing.
- I am using Native FB app with the device Xiaomi Redmi Note 3
-
Naveen Kumar M over 7 yearsI already overridden access tracker. But not resolving my issue
-
Naveen Kumar M over 7 yearsI am already updated key hash. For you after update key hash is the problem resolved?
-
Naveen Kumar M over 7 yearsBut for me not resolved. Check this link developers.facebook.com/bugs/297086380683342 Here so many members facing same issue. I provides steps to reproduce please follow the steps to reproduce.
-
Lokesh Mehta over 7 yearsWhich sdk version you are use
-
Naveen Kumar M over 7 yearsBefore :com.facebook.android:facebook-android-sdk:4.0.0 Now : com.facebook.android:facebook-android-sdk:4.14.1 In both SDK version having an issue
-
jerbotron over 7 yearsdoes anyone know if I should remove my old debug hash keys once I generated my release hash key on facebook?
-
Naveen Kumar M over 7 yearsAfter updating new hash key also having same problem
-
Naveen Kumar M over 7 yearsYes It will occurs in Redmi Note 3. I checked in Nexus Its works fine
-
Anjum.... over 7 yearsMee to i am testing on Redmi Note3 :)
-
Ben Looi over 7 yearsI think it has to do with Redmi ROM or some settings. The Miui forum is down. Tried to allow window pop up in security settings for facebook. Didnt work.
-
NineToeNerd over 7 yearsI just commented on the bug linked by @Naveen above. "Did any of the other people experiencing this bug have to type in a password to get their debug key hash? I didn't have to on the Mac I was using when following the Facebook tutorial. Then I got home, and I looked up how to get the hash on Linux. I had to type in the password "android" this time, and after putting this key into the developer console on Facebook, I was able to use the log in/out feature correctly."
-
Ben Looi over 7 yearsI am trying to get console and server log from xiaomi note. The English forum en.miui.com is down. Not a fb connect bug but a redmi bug. :(
-
Naveen Kumar M over 7 years@NineToeNerd thanks for your comment. But this problem not related to Hash Key. Its completely related to Facebook Native app. Its currectly working in some devices like Nexus , Samsung. But issue with Red Mi Phones
-
Naveen Kumar M over 7 yearsFirst time I authenticated successfully. When I Uninstall and install now try to access Fb Login now AccessToken.getCurrentAccessToken() is null. Its not null in nexus devices right now issue is facing on Redmi devices and some of the samsung devices also.
-
Naveen Kumar M over 7 yearsIn Facebook Fixed error. Actual error message was sending wrong from Facebook. Now they found that and fixed and sending as Invalid Hash Key error. I Created a new hash key for debug and release now Its working fine. Thanks for your answer
-
Ganesh AB over 6 yearsAre you sure about this? Is this issue resolved now?
-
Naveen Kumar M over 6 yearsYes it was resolved on that instance. But not sure about now. If you having any issue raise the bug in developers.facebook.com/bugs
-
Morgan Koh almost 5 yearsIt'll save you time if you can just get the keyhash from your
packageManager
instead. stackoverflow.com/a/56388262/2867351 -
Kishore Kumar over 4 yearsThis is the perfect answer , it happens
-
Osama Ibrahim over 4 yearsMany Thanks, you save my day
-
Ketan Ramani over 4 yearsTry this solution if none of the solution listed in this page is not working: stackoverflow.com/a/59316144/6667442
-
D.Hodges about 4 years@MorganKoh is there a way to do this if you're building an Ionic App?
-
jack_07 about 4 yearsMine issue is , it is working in some devices and not working in other devices (Samsung, Redmi). After putting key into developers console, app is crashing for specific devices (Samsung, Redmi)
-
Abhijit Kurane almost 4 yearsFixed this issue by following the steps you mentioned. Lot thanks, you saved my time :-)
-
Krunal Shah almost 4 yearsMy app is not released, it is still in under development. I am creating the release build and also create release Keystore and generate a sha1 hash key using release Keystore. But still I am not able to log in, if the Facebook app is installed, without facebook app from web login dialog its working. Please help me to solve it. @SumiSadic
-
Otuyh almost 4 yearsThis one was the ONLY ANSWER to solve my problem. I'm executing EXACTLY the steps told in facebook getting started, but still failing. I have this problem for years, and still today, the only code that works is that hex to base64 site gives.
-
ACAkgul almost 4 yearsthis must be joke, same issue was here and i resolved by your solution, thanks !
-
Odai A. Ali over 3 yearsYour answer solved My Issue with this stubborn Facebook Error
-
avisper about 3 yearsbest solution! works perfect. Independent, if user has an updated facebook app or problems like that
-
Arun Wilson about 3 yearsThanks @Rasheed Qureshi, tried all methods, but your method save me.
-
Ali Yar Khan over 2 yearsdo i have to put my upload-keystore.jks file too in the app folder ?
-
HandyPawan over 2 yearsGreat answer buddy!
-
Junkkung HangHeng over 2 yearsI have spent a few day to sloved this problem. This comment is very useful and I suggest this comment in github too. github.com/AntonioCuevaUrraco/nativescript-facebook-login/…. And try to run
gradlew signingReport
or./gradlew signingReport
at android root project and find something xx-release then compare SHA1 with above method in github you will understand when you see it. This might help you. ;) -
Narcis about 2 yearsThank you for this, it saved me! Note that you need to follow the steps of going to Release Management → App Signing only if you chose Google to handle app signing for you (which is anyways recommended).