简体   繁体   English

是否有人对com.google.android.gms.common.api.ApiException:16有任何想法?

[英]Does anyone have any idea about com.google.android.gms.common.api.ApiException: 16?

I am getting a rather strange ApiException when trying to sign into a Google account from my application. 尝试从我的应用程序登录Google帐户时,我遇到了一个非常奇怪的ApiException。 I can reproduce this only on a device that is in Alpha testing that has had a previous version of the application (without Google sign in option). 我只能在经过Alpha测试的设备上具有该应用程序的先前版本(没有Google登录选项)才能重现此内容。 If I do a clean install on an emulator or a real device there is no problem getting authenticated. 如果我在模拟器或真实设备上进行全新安装,则通过身份验证不会有问题。 It might be messed up from some of the previous (faulty) versions that were in Alpha testing and I don't want to reinstall it on this device as it is the only way I can currently reproduce it. 它可能与Alpha测试中的某些先前(故障)版本混淆了,我不想在此设备上重新安装它,因为这是我目前可以重现它的唯一方法。

According to Google's documentation, the value I get is: 根据Google的文档,我获得的价值是:

public static final int CANCELED: The result was canceled either due to client disconnect or cancel(). public static final int CANCELED:由于客户端断开连接或cancel(),结果被取消。 Constant Value: 16 常数:16

I can assure you that this doesn't happen explicitly neither in the code nor by me when testing it. 我可以向您保证,无论是在代码中还是在测试时,我都不会明确地发生这种情况。 As I said, I have already tested it on one other physical device and on several emulated devices and I can authenticate multiple accounts fine. 就像我说的那样,我已经在另一台物理设备和几台模拟设备上进行了测试,并且可以对多个帐户进行身份验证。

Has anyone faced this error and does anyone have any ideas as to why might I get it? 有没有人遇到过这个错误,并且有人对我为什么会得到它有任何想法吗?

Sorry for the way I attached the logs but I can't get them any other way: 很抱歉,我附加了日志,但无法以其他任何方式获取它们:

在此处输入图片说明

It turns out that, if the application is deployed on the Google Play Store, the SHA1 signing key is different to the one produced from Android Studio (which the documentation says you should use). 事实证明,如果将应用程序部署在Google Play商店中,则SHA1签名密钥与从Android Studio生成的密钥不同(文档指出您应该使用该密钥)。

All I had to do to fix this was locate the SHA1 App Signing Certificate for my application (from Google Play Console: Release Management -> App Signing) and create a new OAuth2 Android credential in the cloud console with this key, as well as add it to the Firebase console under the project's settings. 解决此问题所需要做的就是找到我的应用程序的SHA1应用程序签名证书(从Google Play控制台:发行管理->应用程序签名),并使用此密钥在云控制台中创建新的OAuth2 Android凭据,然后添加并将其添加到项目设置下的Firebase控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安全网:com.google.android.gms.common.api.ApiException:16: - SAFETYNET : com.google.android.gms.common.api.ApiException: 16: com.google.android.gms.common.api.ApiException: 16: - com.google.android.gms.common.api.ApiException: 16: com.google.android.gms.common.api.ApiException:8: - com.google.android.gms.common.api.ApiException: 8: com.google.android.gms.common.api.ApiException: 10: - com.google.android.gms.common.api.ApiException: 10: 异常com.google.android.gms.common.api.ApiException:12500 - Exception com.google.android.gms.common.api.ApiException: 12500 com.google.android.gms.common.api.ApiException: 12500 - com.google.android.gms.common.api.ApiException: 12500 com.google.android.gms.common.api.ApiException: 10 - com.google.android.gms.common.api.ApiException: 10 带有com.google.android.gms.common.api.ApiException的Google Awareness API位置:7508 - Google Awareness API Places with com.google.android.gms.common.api.ApiException: 7508 com.google.android.gms.common.api.ApiException: 17: API: Drive.API_CONNECTIONLESS 在此设备上不可用 - com.google.android.gms.common.api.ApiException: 17: API: Drive.API_CONNECTIONLESS is not available on this device com.google.android.gms.common.api.ApiException:12500,在Google的Android Firebase项目中登录 - com.google.android.gms.common.api.ApiException: 12500, in android firebase project in google sign in
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM