[英]Flutter: Firebase: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
I am getting this exception when I sign in using google. 使用Google登录时出现此异常。 This exception only comes after the apk is uploaded for internal app sharing. 仅在上载apk进行内部应用共享后才出现此异常。 If we manually download this apk then every thing works perfectly fine. 如果我们手动下载此apk,则一切正常。 This works in debug but not in release. 这适用于调试,但不适用于发行版。
I have tried the below: 我尝试了以下方法:
Below gradle code 在gradle代码下面
signingConfigs {
release {
keyAlias 'key'
keyPassword 'pass'
storePassword 'pass'
storeFile file('/Users/xyz/file.keystore')
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.debug
}
}
dependencies {
...
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
}
apply plugin: 'com.google.gms.google-services'
Expected: Successful sign in using google. 预期:使用Google成功登录。 Actual result: Getting exception:PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
实际结果: Getting exception:PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
For the Google signing in your internal shared link you firstly need to add your internal App Sharing SHA-1 Key to your Firebase console. 要让Google登录您的内部共享链接,您首先需要将内部“应用共享SHA-1”密钥添加到Firebase控制台。
Steps are as below. 步骤如下。 (1) upload your application to google console for internal app sharing. (1)将您的应用程序上传到Google控制台以进行内部应用程序共享。 (2) Go to the App certificates of the internal app sharing. (2)转到内部应用共享的应用证书。 (3) Copy the SHA-1 Certificate key. (3)复制SHA-1证书密钥。 (4) Add This SHA-1 Certificate key to your Firebase Console. (4)将此SHA-1证书密钥添加到Firebase控制台。 (5) Save the changes on Firebase Console. (5)将更改保存在Firebase控制台上。
And For releasing Application with Google Sign_in feature Follow Below Steps. 对于使用Google Sign_in功能发布应用程序,请遵循以下步骤。 (1) upload your application to google console on release rab. (1)在rab版上将您的应用程序上传到Google控制台。 (2) Go to App signin tab and copy the SHA-1 certificate key. (2)转到“应用程序登录”选项卡,然后复制SHA-1证书密钥。 (3) Add SHA-1 certificate key to your Firebase Console. (3)将SHA-1证书密钥添加到Firebase控制台。 (4) Save the changes on Firebase Console. (4)将更改保存在Firebase控制台上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.