2015-10-16 70 views
1

我一年前下载了Android Starter应用程序,并在其上写下了我的代码。 Google认证过去一直很好,直到很久以前。
我启用了Google,Facebook和Yahoo认证。
我在我的网站上实现了Google登录工作正常的Gitkit v3。Gitkit Android:gms.StatusHelper电线状态:INVALID_AUDIENCE状态:null

现在,在我的Android应用程序中,自定义用户标识身份验证工作正常,但Google身份验证不是。

当选择Gmail ID时,什么也没有发生:onSignIn()onSignInFailed()都被触发。

在过去的一年中,这部分中的任何服务器端代码更改都不是向后兼容吗?

===================================

在logcat中,会产生以下异常

10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient: Unrecoverable auth exception: Unknown 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient: com.google.android.gms.auth.GoogleAuthException: Unknown 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.idp.google.GoogleIdpClient$1.call(GoogleIdpClient.java:131) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.idp.google.GoogleIdpClient$1.call(GoogleIdpClient.java:125) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.executor.ProgressRequestExecutor$2.doInBackground(ProgressRequestExecutor.java:84) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.executor.ProgressRequestExecutor$2.doInBackground(ProgressRequestExecutor.java:71) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at android.os.AsyncTask$2.call(AsyncTask.java:295) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
10-16 21:29:40.928 6453-14199/com.application.my_app E/GooglePlusIdpClient:  at java.lang.Thread.run(Thread.java:818) 
10-16 21:29:40.933 6453-6480/com.application.my_app E/Surface: getSlotFromBufferLocked: unknown buffer: 0x9f1fb160 

==========================

更新:当选择一个Gmail的ID为登录可见1
我尝试使用Android的新客户端ID并在我的Python端点代码中使用它。这没有帮助。

==========================

更新2
我创建了一个新的Client ID for Web application和端点用它python文件(如WEB_CLIENT_ID)和AndroidManifest.xml(值为identitytoolkit.server_client_id)。以下例外仍然存在:

10-18 09:43:38.000 12063-15754/? W/GLSActivity: gms.StatusHelper Status from wire: INVALID_AUDIENCE status: null 
10-18 09:43:38.000 12063-15754/? I/GLSUser: [GLSUser] getAuthtoken(<ELLIDED:-2092860235>, audience:server:client_id:My_NEW_Client_Id__For_Web_Application.apps.googleusercontent.com) -> status: UNKNOWN) 
10-18 09:43:38.000 12063-15754/? I/GLSUser: [GLSUser] Extracting token using key: Auth 
10-18 09:43:38.000 12063-15754/? W/GLSActivity: gms.StatusHelper Status from wire: INVALID_AUDIENCE status: null 
10-18 09:43:38.050 1914-3643/? I/ActivityManager: Start proc 2421:com.google.android.partnersetup/u0a11 for broadcast com.google.android.partnersetup/.RlzPingBroadcastReceiver 
10-18 09:43:38.117 12147-12257/? W/Icing: GetUsageReports fallback to slow seek 
10-18 09:43:38.120 1914-2954/? I/ActivityManager: Killing 32316:com.android.defcontainer/u0a4 (adj 15): empty #17 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient: Unrecoverable auth exception: Unknown 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient: com.google.android.gms.auth.GoogleAuthException: Unknown 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.idp.google.GoogleIdpClient$1.call(GoogleIdpClient.java:131) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.idp.google.GoogleIdpClient$1.call(GoogleIdpClient.java:125) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.executor.ProgressRequestExecutor$2.doInBackground(ProgressRequestExecutor.java:84) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at com.google.identitytoolkit.executor.ProgressRequestExecutor$2.doInBackground(ProgressRequestExecutor.java:71) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at android.os.AsyncTask$2.call(AsyncTask.java:295) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
10-18 09:43:38.163 1233-2364/com.application.my_app E/GooglePlusIdpClient:  at java.lang.Thread.run(Thread.java:818) 
10-18 09:43:38.178 1233-1272/com.application.my_app E/Surface: getSlotFromBufferLocked: unknown buffer: 0x9f355b50 

请帮忙。

回答

0

我能够解决问题,至少部分。问题在于我提供了名称为"package"的名称,其中包名是在Google Developer Console上要求输入密钥的。我应该提供"build.gradle"中提到的"applicationId"。就我而言,两者都不同。由于在所有文档中,都提到了提供软件包名称,我感到困惑。

做出更改后,Google身份验证正在运行。我正在研究Facebook身份验证,但仍然无法正常工作。

我已经迁移到最新Gitkit图书馆,我发现了以下的功能缺失在新的Android库:

我试图找出他们的解决方法:

IdToken idToken = client.getSavedIdToken(); 
Account account = client.getSavedAccount(); 

下面的链接解释这一部分

http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

从上述链接相关摘录

因此,我们去耦包名的两种用法:就是在你的内置apk文件的清单中所使用的最后 包,是 您的应用程序被称为您的设备上,并在谷歌Play商店的包,是“应用程序ID” 。在您的源代码中使用到 的包涉及您的R类,并解决任何相对活动/服务 注册,继续称为“包”。