android - GoogleService 初始化失败,状态 : 10, 缺少名称为 google_app_id 的字符串资源中的 google app id 值

标签 android firebase firebase-cloud-messaging google-play-services

我莫名其妙地收到这个错误,它以前工作得很好。这是我所拥有的:

在 app.gradle 依赖中:

implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.3.1"

在 app.gradle 文件末尾:

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

在项目gradle文件中:

 dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha10'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'io.fabric.tools:gradle:1.+'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.1.0'
    }

并且 google-services.json 位于我项目的几乎每个文件夹中,只是为了查看它是否正常工作。

但仍然出现上述错误。

最佳答案

更新到 Android Studio 3.3 后,我开始遇到同样的错误。事实证明,com.google.gms:google-services4.1.0 版本在 Android Studio 3.3 中存在一个已知问题。

更新到 com.google.gms:google-services:4.2.0 为我解决了这个问题。

关于android - GoogleService 初始化失败,状态 : 10, 缺少名称为 google_app_id 的字符串资源中的 google app id 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52374463/

相关文章:

android - 使用 LoaderManager 和 CursorLoader 在 ListView 中显示专辑和艺术家

javascript - 如何停止执行 Firebase 触发的 Firebase 函数?

python - 如何获取用于 Firebase 云消息传递的 OAuth2.0 token

android - 如果满足某些条件,是否可以使用 firebase 创建自动推送通知,而无需网络?

ios - iOS 10 上未收到 Firebase 通知

java - 列表中的 OnItemClick 选择了错误的项目?

java - 在 Fragments 中使用异步任务时如何避免应用程序崩溃?

android - 安装没有成功完成。详见 IDE 日志 - Android studio

node.js - 为什么 Cloud Functions 日志消息为空?

javascript - Firebase 安全问题/身份验证