The error of using an invalid hash key error when using the Facebook SDK in Android apps seems to be rather common. And the solution I found in this Stackoverflow article worked perfectly. I created the hash key programmatically in my app and did a Copy&Paste of the key into the interface of the Facebook Developer page of my app.
Despite finding this and alternative solutions, I couldn't find a good explanation why I got this error all of a sudden.
When I use the keystore command below, I still get the same hash key that was already registered on my Facebook developer page and which worked neatly so far (so right now I'm having 2 registered hash keys)
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
I didn't change the development environment, i.e., the PC to develop my app.
Just a couple of hours before I got this error, I gave the app to a new registered tester, who could logged into my app perfectly fine
I'm currently only developing and testing, so the app is not made public yet
Singing in and out still worked fine on the emulator. Only on my own phone I use for testing the app on a physical device I suddenly got this error after I signed out and wanted to sign in again.
I'm just trying to understand what's going on here so I know what to expect and what to do once I go public with the app. As I understand, there's a debug key and a production key. But even if the new key is the production key, why did this happen?
Why are the hash keys - the one I generate using the keytool
command and the one that I generate within the app - different?