【问题标题】:GoogleService failed to initialize, status: 10, Missing google app id value from from string resources with name google_app_idGoogleService 初始化失败,状态:10,缺少来自名称为 google_app_id 的字符串资源的 google app id 值
【发布时间】:2018-09-17 19:25:07
【问题描述】:

我突然发现这个错误,它以前工作得很好。这是我所拥有的:

在 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 firebase firebase-cloud-messaging google-play-services


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我遇到了同样的错误,不确定根本原因是什么,但作为一种变通方法找到了解决方案。

      classpath 'com.google.gms:google-services:4.1.0' 降级为classpath 'com.google.gms:google-services:4.0.0',它应该可以工作,至少它对我有用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-03-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多