Android Facebook SDK: Key hash does not match

开发一个Android App,其中使用了Facebook SDK,需要向Facebook提交该App的key hash。

按照Facebook官方步骤,使用以下命令即可生成key hash:

keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64
然而,App一直未能正确运行,很简单的一个App,各种因素干扰,找了很久原因,终于确认是key hash不匹配的问题,然而,为什么呢,一切操作皆遵守官方,已经试了几百遍了!


Fuck openssl! A big waste of time!

问题便出在openssl上,openssl较新的版本09.8k存在bug,其计算得出的key hash可能是错误的,我们回滚到0.9.8e版本,问题得以解决。so,用开源的东西有时候是有代价的。


以下是国外的受害者:

@fernandomatos

Hi guys,

Windows users have to be careful about openssl-for-windows (http://code.google.com/p/openssl-for-windows/downloads/list), the latest version, at least on plataform 64bits, don't generate the correct hash that Facebook need it for android apps.

When we are using this plugin we need provide a security hash to the facebook, in our aplication page (https://developers.facebook.com/apps), if what i'm saying don't make sense for you I recomend you read these materials:
http://developers.facebook.com/docs/mobile/android/build/#sig
http://developer.android.com/guide/publishing/app-signing.html

If you've read these materials and already know how works and how you will have to do to generate your security hash to use this plugin, remember of this tip:

Use one of this versions: openssl-0.9.8e_X64.zip or openssl-0.9.8d_X64.rar

You should not use the openssl-0.9.8k_X64.zip.

I hope this tip be useful. I lost a lot of time, testing ways to generate the correct hash and in the end the problem was with the latest version of openssl.


buhlly88 commented  on 26 Nov 2011

fernandomatos,
Just wanted to say thank you. I spend 2 days banging my head against the wall until I finally came across this post. Once I used the older version of openssl to generate the security hash it worked.

Thanks for posting.


kotibabu commented  on 23 Jul 2012

thank you from past 3 days i spent time with this through you post my issue is solved


chaunvbka commented  25 days ago

thanks you very much. I also lost a lot of time with this problem.



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值