使用Flutter构建Appbundle时的PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,null) [英] PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) when using Flutter to build an appbundle

查看:139
本文介绍了使用Flutter构建Appbundle时的PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,null)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 firebase_auth google_sign_in

一切工作了一段时间,我所有的现有用户都在发行的产品没有遇到任何问题,但是不久前,我开始收到新用户无法登录的报告。直到报告开始积累之前,我并没有考虑太多。我发现他们在标题中发现了错误。我花了很多时间来调查...

Everything was working well for a while and all of my existing users on the released product have not experienced any problems, but a while back I started getting reports that new users couldn't log in. I didn't think much of it until the reports started to accumulate. I found that they were getting the error posted in the title. I spent a ton of time investigating...

我已经遍历了所有其他StackOverflow条目:

I've gone through all of the other StackOverflow entries for this issue:


  1. 未处理的异常:PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,null)

  2. PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:, null)

  3. 发生异常。 PlatformException(PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,null))

  4. Flutter:Firebase:PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException :10:,null)

  5. 扑扑:PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,空)

  6. Flutter和google_sign_in插件:PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException:10 :,空)

  7. com.google.android.gms.common.api.ApiException:10:

  8. com.google.android.gms.common.api.ApiException:10

  9. 如何纠正" com.google.android.gms.common.api.ApiException:10:

  10. Firebase Google登录错误:com.google.android.gms.common.api.ApiException:10

  11. Google登录失败com.google.android.gms.common.api.ApiException:10:

  12. 为什么会出现com.google.android.gms.common.api.ApiException:10 :?

  13. 错误随手可得的Google_sign_in插件

  1. Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
  2. PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
  3. Exception has occurred. PlatformException (PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null))
  4. Flutter: Firebase: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
  5. Flutter: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
  6. Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
  7. com.google.android.gms.common.api.ApiException: 10:
  8. com.google.android.gms.common.api.ApiException: 10
  9. How to correct " com.google.android.gms.common.api.ApiException: 10: "
  10. Firebase Google Signin error: com.google.android.gms.common.api.ApiException: 10
  11. Google sign in failed com.google.android.gms.common.api.ApiException: 10:
  12. Why do I get com.google.android.gms.common.api.ApiException: 10:?
  13. Error with Google_sign_in plugin in flutter

我已经尝试了所有解决方案:

And I've tried all of the solutions:


  • 生成的调试密钥

  • Firebase网站

  • 已验证我的电子邮件是在Firebase网站上输入的。

  • 下载了google-services.json文件并将其放入 android / app / 目录

  • 使用 flutter build appbundle --debug

  • PlatformException(sign_in_failed,com.google.android.gms.common.api .ApiException:10:,null)

  • Generated debug key
  • Entered SHA1 debug key on the Firebase site
  • Verified that my email was entered on the Firebase site.
  • Downloaded the google-services.json file and put it in the android/app/ directory
  • Built the flutter app using flutter build appbundle --debug
  • PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

所以我也尝试过:


  • 仅使用Firebase网站上的发布密钥,并使用 flutter构建附件--release

  • 同时使用释放键和调试键

  • 对于上述每个组合都使用SHA256

  • 对于每个组合,我都可以肯定到颤抖干净并替换ce google-services.json文件中已更新的

  • With just the release key on the Firebase site and built with flutter build appbundle --release
  • With both the release key and the debug key
  • With the SHA256 for each combination above
  • With each of these combinations, I was sure to flutter clean and replace the google-services.json file with the updated one

已验证 android / build.gradle android / app / build.gradle 配置正确

以下是我运行的版本:

  google_sign_in: ^4.0.7
  firebase_auth: ^0.14.0+5

android / app / build.gradle的相关部分:

Relevant portion of the android/app/build.gradle:

dependencies {
    implementation "androidx.appcompat:appcompat:1.1.0-alpha01"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation "com.google.android.gms:play-services-auth:16.0.1"
    implementation "com.google.android.gms:play-services-identity:16.0.0"
    implementation "com.android.support:support-v4:28.0"
}

apply plugin: 'com.google.gms.google-services' 

android / bu的相关部分ild.gradle:

Relevant portion of the android/build.gradle:

buildscript {
   ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.2'
    }
}

颤振医生输出:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Linux, locale en_US.UTF-8)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.38.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

所有测试都是使用Firebase上的Robo测试实验室在多台设备上完成的(仅查看登录是否

All testing was done on multiple devices using the Robo test lab on Firebase (only to see if the login was successful, not to test the UI).

TLDR;
最后,我终于弄清楚了,如果我使用 flutter build apk (而不是一个appbundle)来构建apk,它就可以工作。然后我意识到问题开始出现的时间与Flutter开始建议我生成Appbundles而不是apk的同时。

TLDR; In the end, I finally figured out that it works if I build the apk using flutter build apk (as opposed to an appbundle). Then I realized that the problem started about the same time that flutter started recommending that I generate appbundles instead of apks.

任何人都可以登录BRAND (请记住,以前登录该应用程序早期版本的现有用户可以正常工作)。

Has anyone been able to sign in a BRAND NEW USER with flutter using google_sign_in when generating an appbundle? (Keep in mind that existing users who previously signed in to an earlier version of the app work without issue.)

推荐答案

如果您使用内部应用程序共享在实际的Android设备上(例如我)测试Flutter构建,则有另一个应用程序签名证书指纹。您需要添加指纹。

If you are using Internal App Sharing to test Flutter builds on actual Android devices (like I am), there is another App Signing certificate fingerprint you need to add.

在Google Play控制台的左侧导航中,转到:开发人员工具->内部应用共享

On the left navigation of Google Play Console go to: Developer Tools -> Internal App Sharing

选择应用程序证书标签。应该看起来像这样:

Select the App Certificate tab. Should look something like this:

Google播放-内部应用共享-证书

复制SHA1密钥并将其添加到Firebase控制台->项目设置-> [您的Android应用]-> SHA证书指纹(使用按钮添加指纹)

Copy the SHA1 key and add it to the Firebase Console -> Project Settings -> [your Android app] -> SHA certificate fingerprints (use the button to Add fingerprint)

下载您的更新后的google-services.json 并进行更新/将其添加到项目的android / app文件夹中。

Download your updated google-services.json and update/add it in your android/app folder of your project.

此功能适用于新用户和现有用户。我使用 flutter构建appbundle

This works with new users and existing users. I built the an appbundle (not APK) using flutter build appbundle

构建了一个appbundle(不是APK),Google和我在Flutter社区的其他地方都没有看到这种解决方案。在尝试了您所有引用的链接和其他几个链接之后,我在Google Play控制台中闲逛时遇到了这个解决方案。

This isn't documented anywhere by Google and I have not seen this solution elsewhere in the Flutter community. I came across this solution while poking around in the Google Play console after trying all of your referenced links and several others.

这篇关于使用Flutter构建Appbundle时的PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10:,null)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆