I have facebook login setup in my android app. When the user clicks login (with the facebook app installed on their phone) the app returns:
“Login Failed: invalid_key: Android Key mismatch. Your key”
This happens on every phone but my development phone. I generated the key through the facebook developer site with this command: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
I assume the problem is the registered key in facebook is for debug when it needs to be for distribution. If this the case how do i create the distribution key that will be valid for all apps downloaded from the app store?
There is a workaround for apps using FB SDK. You can create debug keystore with your release key (by exporing and importing via JDK keytool or GUI tool such as KeyStore Explorer for Windows or it’s analog for any other OS).
Your new keystore and key should have the following credentials (by android dev guide):
After it provide path to new keystore in eclipse or ant.properties and calculate a hash for your new debug key that will be equal to a hash of your old release key (for example using android-fb-keytool, that doesn’t require JDK or OpenSSL).