Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Facebook Developers Can't "Save Changes" on "Sample App Settings" for "Android Key Hash"

Hi Stackoverflow community,

I logged into developers.facebook.com and am trying to hit "Save Changes" on the "Sample App Settings" for "Android Key Hash". (After typing in an Android Key Hash)

Facebook Picture

I have saved two other Android key hashes in the past (because I switched computers/ struggled to find the right key hash), but now I can't add a third key hash.

My first guess was that the key has I found was invalid, but it's the one I got from following the directions at https://developers.facebook.com/docs/android/login-with-facebook/, so I doubt it.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

try {
    PackageInfo info = getPackageManager().getPackageInfo(
        "com.replaced.with.my.pakage.name.here", 
        PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}
...

I seem to have been locked out? Any thoughts on how to resolve this error?

like image 385
satoukum Avatar asked Feb 16 '26 17:02

satoukum


1 Answers

I realized that the number of characters in the hash key that I got from Facebook and that generated using the keytool command was not the same, because I which the Save Changes button was not getting enabled.. I added the last character of the longer to the shorter one and it worked

like image 135
Mustafa Khimani Avatar answered Feb 18 '26 05:02

Mustafa Khimani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!