Android Facebook SDK : "(# 404) Keyhash XXXXXX does not match any stored key hashes"

sudhishkr picture sudhishkr · Mar 7, 2014 · Viewed 8.7k times · Source

I am trying Android Facebook integration for an app. I am new to this.

I have got the Facebook SDK & I am trying to run a few samples from there. When I run the samples I get this error " (# 404) Keyhash XXXXXX does not match any stored key hashes ".

The XXXXXX is probably my keyhash, I did some basic search about what it is. I read this and I compared the XXXXXX value with the Java Keytool.exe from my machine. There was a match with these numbers.

I have to get this working - I feel I have to add this somewhere on Facebook developer site. Can someone tell me if thats correct & also how to do it. OR my approach may be wrong too, if you can guide me to the correct approach. That will be helpful.

Thanks!

Answer

siva picture siva · Apr 28, 2014

After spending few hours and referring few answers here. finally its worked for me. few observations:

  1. hashcode generated by Keytool is not same as hashcode showing in exception. Use the later one.
  2. For Facebook Sample apps we need to add the hash for SampleApp.Here if we entered the hash and click on SaveChanges its clearing and not saved.So before clicking the SaveChanges need to hit the enter key and make sure its not clearing.
  3. need to append = at the end of hashkey shown in exception.