1

一年前我下载了 Android 入门应用程序,并在其上编写了我的代码。直到前一段时间,Google 身份验证都可以正常工作。
我启用了 Google、Facebook 和 Yahoo 身份验证。
我已经在我的网站上实现了 Gitkit v3,目前谷歌登录工作正常。

现在,在我的 Android 应用程序上,自定义用户 ID 身份验证工作正常,但 Google 身份验证没有。

选择 Gmail ID 后,什么都不会发生:既onSignIn()不会也不会onSignInFailed()被解雇。

过去一年是否在这部分实施了任何不向后兼容的服务器端代码更改?

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

在 logcat 中,当为 Sign In 选择 Gmail Id 时会出现以下异常:

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 

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

更新 1
我尝试使用新的 Android 客户端 ID 并在我的 Python 端点代码中使用它。这没有帮助。

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

更新 2
我创建了一个新的Client ID for Web application并在端点 python 文件( as WEB_CLIENT_ID)和 AndroidManifest.xml ( as 的值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

请帮忙。

4

1 回答 1

0

我能够解决问题,至少部分解决。问题是我提供了"package"在 Google Developer Console 上询问包名称的名称。我应该提供"applicationId"我的"build.gradle". 就我而言,两者都是不同的。由于在所有文档中都提到提供包名称,所以我很困惑。

进行此更改后,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 清单中使用的最终包,也就是您的应用在您的设备和 Google Play 商店中被称为的包,是“应用程序 ID” . 源代码中用于引用 R 类和解析任何相关活动/服务注册的包仍称为“包”。

于 2015-10-19T08:07:12.540 回答