我已经在我的应用程序中使用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
Logcat:
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)
更新 但是,当我更改我的桌面并尝试使用相同的项目相同的项目时它工作得很好。不知道什么是问题。