首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用PlatformException(sign_in_failed,sign_in_failed 10:,null)构建应用程序包时

使用PlatformException(sign_in_failed,sign_in_failed 10:,null)构建应用程序包时
EN

Stack Overflow用户
提问于 2019-10-02 02:21:06
回答 1查看 1.5K关注 0票数 1

我正在用身份验证在……里面开发一个颤振应用程序。

一切正常运行了一段时间,我发布的产品上的所有现有用户都没有遇到任何问题,但不久前,我开始收到新用户无法登录的报告。直到报告开始积累,我才开始考虑这件事。我发现他们把错误贴在标题上。我花了很多时间调查..。

对于这个问题,我已经浏览了所有其他StackOverflow条目:

  1. 失败,com.google.android.gms.common.api.ApiException: 10:,null)
  2. 失败,com.google.android.gms.common.api.ApiException: 10:,null)
  3. 失败,com.google.android.gms.common.api.ApiException: 10:,null))
  4. 失败,com.google.android.gms.common.api.ApiException: 10:,null)
  5. 失败,com.google.android.gms.common.api.ApiException: 10:,null)
  6. 失败,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. 如何更正“com.google.android.gms.common.api.ApiException: 10:”
  10. Firebase Google登录错误: com.google.android.gms.common.api.ApiException: 10
  11. 谷歌登录失败的com.google.android.gms.common.api.ApiException: 10:
  12. 为什么我得到com.google.android.gms.common.api.ApiException: 10:?
  13. 插在颤振中

我尝试过所有的解决方案:

  • 生成的调试键
  • 在SHA1上输入火场调试键
  • 验证我的电子邮件是在Firebase站点上输入的。
  • 下载了google-services.json文件并将其放在android/app/目录中
  • 使用flutter build appbundle --debug构建颤振应用程序
  • com.google.android.gms.common.api.ApiException: 10:,null)

所以我也试过:

  • 仅使用Firebase站点上的发布键并使用flutter build appbundle --release构建
  • 同时使用发布键和调试键
  • 上面每一个组合的SHA256
  • 使用这些组合中的每一个,我肯定会用更新的flutter clean替换google-services.json文件。
  • 验证了android/build.gradleandroid/app/build.gradle配置得当
  • 验证在Firebase站点上启用了"Google“作为”登录方法“。
  • 我甚至填写了我的应用程序名称,徽标,电子邮件,主页,隐私,和服务条款链接和保存OAuth同意书筛选

下面是我正在运行的版本:

代码语言:javascript
运行
复制
  google_sign_in: ^4.0.7
  firebase_auth: ^0.14.0+5

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

代码语言:javascript
运行
复制
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/build.gradle的相关部分:

代码语言:javascript
运行
复制
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'
    }
}

颤振医生输出:

代码语言:javascript
运行
复制
$ 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测试实验室(只为了查看登录是否成功,而不是测试UI)。

最后,我终于发现,如果我使用flutter build apk (而不是appbundle)构建apk,它就能工作。然后,我意识到问题开始的时候,颤振开始建议我生成应用包,而不是apks。

有谁能在生成appbundle?时使用google_sign_in注册一个全新的用户(请记住,以前登录到早期版本的应用程序的现有用户没有问题)。

EN

Stack Overflow用户

发布于 2019-11-12 01:28:03

如果您正在使用内部应用程序共享在实际的安卓设备上测试颤振构建(就像我一样),您需要添加另一个应用程序签名证书指纹。

在Google控制台的左侧导航转到:Developer Tools ->内部应用程序共享

选择“应用程序证书”选项卡。应该是这样的:

Google Play -内部应用程序共享-证书

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

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

这适用于新用户和现有用户。我使用flutter build appbundle构建了一个appbundle (而不是APK)

谷歌在任何地方都没有记录到这一点,我也没有在颤栗社区的其他地方看到过这种解决方案。在尝试了所有引用的链接和其他几个链接之后,我在Google控制台中浏览了一下这个解决方案。

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58194425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档