1

当我在 android 上登录时使用 facebook sdk 进行统一时,我遇到了一个问题(真实设备 - Gooogle nexus 7 2012)。- adb logcat 此错误:W/fb4a(:):BlueServiceQueue(10494): 服务期间出现异常 W/fb4a(:):BlueServiceQueue(10494): com.facebook.http.protocol.ApiException: Key hash rhDpGcyTNP33kRZOYIKdOcoevoM 不匹配任何存储的密钥哈希。W/fb4a(:):BlueServiceQueue(10494): 在 com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:83) W/fb4a(:):BlueServiceQueue(10494): 在 com.facebook.http。 protocol.ApiResponseChecker.a(ApiResponseChecker.java:162) W/fb4a(:):BlueServiceQueue(10494): 在 com.facebook.http.protocol.ApiResponse.h(ApiResponse.java:239) W/fb4a(:): BlueServiceQueue(10494):在 com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:272) W/fb4a(:):BlueServiceQueue(10494):HandlerThread.run(HandlerThread.java:60) W/Bundle (12430):密钥 com.facebook.platform.protocol.PROTOCOL_VERSION 预期的字符串,但值是 java.lang.Integer。已返回默认值。W/Bundle (12430):尝试转换生成的内部异常:W/Bundle (12430):java.lang.ClassCastException:java.lang.Integer 不能转换为 java.lang.String

..... .... V/FBUnitySDK(21692): 发送到 Unity OnLoginComplete({"cancelled":true}) I/Unity (21692): 调用登录: I/Unity (21692): I/Unity ( 21692): (文件名: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp 行: 54) I/Unity (21692): I/Unity (21692): 登录结果: {"is_logged_in":false,"user_id":" ","access_token":""} I/Unity (21692): I/Unity (21692): (文件名: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp 行: 54)

  • 当我卸载 facebook 应用程序时,此应用程序运行良好。
  • 我认为发生此错误是因为我的密钥哈希。请帮我解决这个问题。(对不起我的英语不好)
4

1 回答 1

3

您传递给 Facebook SDK 的密钥哈希不会存储在您的开发者帐户中。

W/fb4a(:):BlueServiceQueue(10494): com.facebook.http.protocol.ApiException: Key hash rhDpGcyTNP33kRZOYIKdOcoevoM does not match any stored key hashes. 

转到developers.facebook.com/apps/并将其添加到android部分(密钥哈希rhDpGcyTNP33kRZOYIKdOcoevoM)

于 2013-10-29T06:45:51.107 回答