【问题标题】:Gitkit Android : gms.StatusHelper Status from wire: INVALID_AUDIENCE status: nullGitkit Android:gms.StatusHelper 来自电线的状态:INVALID_AUDIENCE 状态:null
【发布时间】:2015-10-16 15:55:09
【问题描述】:

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

现在,在我的 Android 应用上,自定义用户 ID 身份验证工作正常,但 Google 身份验证却不行。

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

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

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

在 logcat 中,当为登录选择 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 文件(作为 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

请帮忙。

【问题讨论】:

    标签: google-identity-toolkit


    【解决方案1】:

    我能够解决问题,至少部分解决。问题是我提供了 "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 清单中使用的包,并且是包 您的应用在您的设备和 Google Play 商店中被称为 “应用程序 ID”。源代码中使用的包 参考您的 R 类,并解决任何相关活动/服务 注册,继续被称为“包”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-10
      • 1970-01-01
      • 1970-01-01
      • 2017-07-05
      • 2021-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多