我之前在我的应用程序中使用 facebook 开发了登录,它工作正常,但现在当我按下登录按钮时它不工作,我可以看到询问用户名和密码的对话框,但现在我收到以下错误,我没有对代码进行了任何更改,在谷歌之后我发现它可能会在生成错误的密钥时发生,所以我已经生成并尝试了大约 5 个密钥,但它们都没有工作,
我还找到了以下替代品,但没有奏效
public void printHashKey() {
try {
PackageInfo info = getPackageManager().getPackageInfo("your.package.name",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("TEMPTAGHASH KEY:",
Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
}
这里我有changed package
名字,但这不起作用,我使用生成哈希键
keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Admini.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64
日志猫:
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): Exception during service
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): com.facebook.http.protocol.ApiException: remote_app_id does not match stored id
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:78)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:107)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.http.protocol.ApiResponse.h(ApiResponse.java:208)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:266)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:27)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:144)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:16)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:284)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:185)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:245)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:51)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:191)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at com.facebook.common.executors.HandlerExecutorServiceImpl$ListenableScheduledFuture.run(HandlerExecutorServiceImpl.java:268)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at android.os.Handler.handleCallback(Handler.java:725)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at android.os.Handler.dispatchMessage(Handler.java:92)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at android.os.Looper.loop(Looper.java:137)
06-29 10:23:51.219: W/fb4a(:<default>):BlueServiceQueue(7532): at android.os.HandlerThread.run(HandlerThread.java:60)
更新: 但是当我改变了我的桌面并尝试使用相同的项目和相同的键它工作正常。不知道有什么问题。