Generate Key Hash For Facebook Integration Android

Posted : admin On 20.04.2020

May 08, 2016  Simplest easiest method to access find key hash in windows step by step tutorial for beginners. The key hash is a type of simple authenticate key generate by your android development enviournment which will authenticate our developed android application ( In which we are going to add Facebook login ) and gives us the access to use Facebook login into our app.

  • Mar 09, 2018 How to get Development Key Hashes and Release Key Hash for android app Facebook. Generate SHA1 fingerprint of. Andr.oid Eric 46,469 views. Facebook SDK Integration into Unity Project.
  • Oct 08, 2018 how to get key hashes for facebook integration in android studio for windows. Hashes and Release Key Hash for android app Facebook. To generate facebook key hash for android apps.
  • Once imported, right click on your facebook project and click on properties.Click on android, click on add button and select facebook sdk as the project.Click ok. Creating facebook login application Once everything is complete, you can run the samples, that comes with SDK or create your own application.

How to generate release key hash or sha1 for Facebook in the android studio, This section of the tutorial explains you how to get Key Hashes for the Android Facebook app. Facebook SDK integration to android requires a key hash configuration.

While integrating Facebook SDK, we need to configure Facebook API console with Key Hash. If a key hash is missing you will get App mis-configured error in the Facebook dashboard.

Download the facebook-android-sdk and configured a new app. In the application, settings enable the “Native android app” and enable for Facebook login and deep linking. It asks for key hashes, and I’m stuck. After spending a generous amount of time, I have found two solutions to get the key hashes.

  • Download OpenSSL from Google code (If you have a 64-bit machine you must download OpenSSL-0.9.8e X64, not the latest version)
  • Extract it. Create a folder- OpenSSL in C: / and copy all files here
  • Find “debug.keystore” file path. Most likely it will be inside “C:Users.android” folder. However, if you still don’t find then perform a search. I am sure you are lucky enough to get it.
  • Find keytool.exe path. It will be inside your java/bin directory. In my system it is under “C:Program FilesJavajdk1.6.0_30bin”
  • Open command prompt (Run-> cmd->start) and go to java /bin folder (cd “C:Program FilesJavajdk1.6.0_30bin” command will do it for you)
  • Now you run the below command.
  • Provide password (android), as when you are prompted. You are done. It will generate you the key-hash

Alternative Method and its 100% working

hello all in one of my app I need to get data of fb… I am doing that.

I have created app ID it log in successfully but after log out i Log In then it gives me

What is wrong I am doing? Please suggest I am using Facebook sdk… I have installed Facebook in my phone… this running good in emulator that does not have inbuilt Facebook application installed

this is my code

Answers:

The generate hash key is wrong. You may get the hash key using two steps. One is through command prompt. Another one is through coding. Hash key through command prompt working on first time only. I don’t know the reason. I have also got the same problem. So i tried it through programatically.

Follow this steps:

Paste the following code in oncreate().

Modify “com.example.packagename” with your package name in the above coding without fail(You may found your package name in Android Manifest file).

Run your application. Go to the activity where you pasted the above code. In the logcat search for “KeyHash”. You may found a key hash. Copy the key hash and go to Facebook application dashboard page. Go to settings and enter the details like in the bellow image.

Once you finished the above step. Relaunch the app again you may now log into the facebook.
For more details about key hash check the link

If you add a wrong information in the settings page means it will give some error. so use the correct information there. And also if public(other than you) need to use your application means you need to enable the permission(change 'yes' in the 'Status & Review' next to setting).

Answers:

If you are facing this problem then put this key into your developer.facebook.com

Then make sure your app is live on

This green circle is indicating the app is live

If it is not then follow this two steps for make your app live

Step 1 Go to your application -> setting => and add Contact Email and apply save Changes

Setp 2 Then goto App Review option and make sure this toggle is Yes i added a screen shot

Note: If you want to copy hashkey check the BlueServiceQueue in Logcat.

Generate Key Hash For Facebook Integration Android Software

Answers:

I got the same problem.I was sure that it was due to very small fault and yes it was!!!!
I found the solution.

When generating debug hash key in my computer, I entered the password of my system.But the password should be the following –
Enter keystore password: “android”
This was the only problem in my case.

—– For generating Debug key hash, use this command –

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore openssl sha1 -binary openssl base64

—– To Generate Release key hash, use this command –

keytool -exportcert -alias “alias of keystore” -keystore “Your path to the keystore when signing app” openssl sha1 -binary openssl base64

Provide your keystore password after executing this command.

Answers:

I experienced the same problem. I made a short research on the possible reasons for this strange behavior and I found the following:

  • During the first execution of a new Facebook app, it will allow connection/login even if you don’t specify any key hashes.

  • For me, the tutorial which Facebook provided didn’t generate the correct key hash, because it was giving the wrong configuration. When executing:

make sure you check all properties – the HOMEPATH, the existence of the keystore, etc. Maybe you also have to provide password.

  • What generated the proper configuration was the solution suggested by @Mahendran.

  • Also, if you see the error originally posted (http://i.stack.imgur.com/58q3v.png), most probably the key hash you see on the screen is your real one. If nothing else works, try inputting it in Facebook.

I got all those results with: Windows 7 64-bit edition, Android Studio 1.2.2, JDK 7.

Answers:

If you are using Google Play App Signing:

Open App signing section in Google Play Console, and get SHA1 of app signing certificate, than convert it to base64, for example with this tool: http://tomeko.net/online_tools/hex_to_base64.php?lang=en

To improve search results for Pinnacle Studio Plus 11 Key Generator try to exclude using words such as: serial, code, keygen, hacked, patch, warez, etc. Simplifying your search query should return more download results. Pinnacle studio plus 11 key generator 2007.rar.

Answers:

According Facebook Login for Android, you must provide the Key Hash value. In order to obtain it, you will need the key used to sign your application.

Answers:

I tried all of the above and nothing helped my case with my clients!
Than my client remembered he had the Facebook App installed on his device.
After he removed it the login worked perfectly.
The hashkey has been changed and I’ve replaced the old hash keys at Facebook Developers Console with the key from the error (as suggested above) and it works!
The Facebook App itself might be the issue, so you better figure this out on a device with the Facebook app installed and on a device with the Facebook app not installed and handle both cases.

Answers:

paste the following code into your OnCreate Method

Just modify the package name.Then go to your Log cat and select Debug search here then you will find the hash key. Now copy this hash key and then go to developer.facebook.app_id site then edit your hash key then press save. Now run your android project again I think issue will be resolved.

Answers:

I was having the same problem. First login, just fine, but then, invalid key hash.

Even though this is not a Unity thread, I found my answer here. So I will leave my answer, just in case someone else (strayed like me) stumbles upon it.

Facebook SDK for Unity gets the wrong key hash. It gets the key from “C:Users”your user”.androiddebug.keystore” and, in a perfect world, it should get it from the keystore you created in your project. That’s why it is telling you that the key hash is not registered.

Generate Key Hash For Facebook Integration Android

As suggested by Madi, you can follow the steps on this link to find the right key. Just make shure point them to the keystore inside your project, otherwise you won’t get the right key.

Answers:

After a long research, we found a solution.

We had set permissions as:

loginButton.setReadPermissions(public_profile email);

This worked for the first time, but when we re-logged in to FB, it gave the Invalid Hash Error.

The simple solution was to change the above line to:

And it worked like a bliss!

Generate Key Hash For Facebook Integration Android

Hopefully this helps someone.

Facebook should return the correct exception instead of the misleading invalid hash key error.

Answers:

Generate Sha256 Hash

This code will give you your hash for facebook but you have to follow these steps in order to get the release condidate hash .
1. copy and paste this code in your mainactivity

  1. generate signed apk.
  2. connect your phone to laptop and make sure it stays connected .
  3. install and run the apk in your phone by manually moving the release apk to your phone.

  4. now look at android logcat (use filter KeyHash: ) you should see your release hash key for facebook . simply copy and paste it in your https://developers.facebook.com/apps it’s under settings.

  5. now you can test the app it should work perfectly well.

    good luck.

Answers:

I had the same problem when I was debugging my app. I’ve rewrited the hash that you have crossed out in the attached image (the one that Facebook says is invalid) and added it in Facebook’s developers console to key hashes. Just be careful on typos.

This solution is more like easy work-around than a proper solution.

Answers:

This may help some one with same problem

  1. Generate key hash using below code

keytool -exportcert -alias <your_keystore> alias -keystore <your_keystore_file> openssl sha1 -binary openssl base64

2.Paste it in required field in facebook developer

3.In android studio File->Project Structure

add signing parameters

4.Select flavors

select signing config we created

5.select build type

6.select build varient and build it

Answers:

What facebook used is not the default password and alias for debug. You need to change it following and it will work.

If you have not change anything with default password it should be android.
You can also configure it in the build.gradle file. But the same alias password should be used for generating hash.

Answers:

You must create two key hashes one for Debug and one for Release.

For Debug key hash:

On OS X, run:

On Windows, run:

For Release key hash:

On OS X, run: ( Replace what between <> with your values )

On Windows, use: ( Replace what between <> with your values )

Answers:

Guys here is a lot of right answers. Just one thing. Paste received hash into Application -> Settings -> Main not via fast start tutorial.

Facebook Invalid Key Hash

Answers:

Generate Hash For File

Use below code in onCreate() method of your activity

Generate Key Hash For Facebook Integration Android Download

Run this code, this will generate Hash key. copy this KeyHash in Facebook application setting –> Save changes. then Log in your application. this will work perfectly in future too.

Generate Key Hash For Facebook Integration Android Number

Tags: android, facebook, hash