本文介绍了GoogleService未能初始化,状态:10,名称为google_app_id的字符串资源中缺少google app id值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从头到尾都遇到了这个错误,它过去可以正常工作.这是我所拥有的:

Im getting this error out of nowhere it used to work just fine. Here is what i have:

在app.gradle依赖项中:

in app.gradle dependencies:

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

在app.gradle文件结尾:

in app.gradle end of file:

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

在项目gradle文件中:

in project gradle file:

 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位于我项目的每个文件夹中,只是为了查看它是否正常工作.

And the google-services.json is located in about every folder of my project just to see if it is working.

但仍然出现上述错误.

推荐答案

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

I got the same error, not sure what's the root cause, but as a workaround found a solution.

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

Downgrade classpath 'com.google.gms:google-services:4.1.0' to classpath 'com.google.gms:google-services:4.0.0' and it should work, at least it did for me.

这篇关于GoogleService未能初始化,状态:10,名称为google_app_id的字符串资源中缺少google app id值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 13:28