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