Android: Facebook SDK “Invalid Key Hash” on Ubuntu

I kept getting a different Facebook key hash from the one being actually generated by my debug app when it runs. Turns out I’ve been entering the wrong keystore password.

To get your key hash for Facebook SDK on Ubuntu, run the following command:

In case you don’t have the keytool program yet, you’ll see the following message:

The program ‘keytool’ can be found in the following packages:
* gcj-5-jre-headless
* openjdk-8-jre-headless
* gcj-4.8-jre-headless
* gcj-4.9-jre-headless
* openjdk-9-jre-headless
Try: sudo apt install

What I did was install openjdk-9-jre-headless by running the command:

Wait for your selected program to install and try the first command again to generate key hash for Facebook on Ubuntu.

When prompted for keystore password, try to use “android”.

Related Posts:

Posts that may be related to "Android: Facebook SDK “Invalid Key Hash” on Ubuntu":


A Filipino programmer and baker. When I have time to spare, I blog, play video games, watch series (usually anime), cook dishes, draw, or spend a little time with pets. When I have the rare luxury of time, I get to travel and record song covers too! Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *