Facebook not working with Exported/Signed APK File

前端 未结 3 1617
不思量自难忘°
不思量自难忘° 2021-01-12 19:23

I have recently got Facebook to work when debugging my application by following the insructions on facebooks developer page on how to export and get the hash key we need to

3条回答
  •  野的像风
    2021-01-12 19:41

    You are correct on the key hash's being different from the debug.keystore and the release signing key. To remedy that, follow the steps on this website here: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1

    It has a nice tutorial that will fix the issue in almost no time.

    The gist of it is:

    1. Download OpenSSl for Windows and extract the .zip to a simple location like: c:\openssl with all the contents of the zip extracted in this folder's root.
    2. Copy your signing key file to your JRE installation's bin folder. For example, in my case: C:\Program Files\Java\jre7\bin
    3. While in the bin folder where you copied the signing key, Press SHIFT+ Right Click -> Open command window here.
    4. Run this command: keytool -exportcert -alias YOUR_ALIAS -keystore YOUR_SIGNING_KEY > c:\openssl\bin\debug.txt
    5. Enter your password for the signing key
    6. Now, navigate to the c:\openssl\bin folder and type in the following commands:

    openssl sha1 -binary debug.txt > debug_sha.txt

    And then,

    openssl base64 -in debug_sha.txt > debug_base64.txt

    Done! The debug_base64.txt contains your Key Hash. Copy this in your app console and you are all set.

    This sounds lengthy, but you really will be done in literally 4 - 5 minutes. ;-)

提交回复
热议问题