google-services.json 找不到与任何模块的包名称匹配的客户端

p.a*_*xey 3 android firebase

我将应用程序中的应用模块重命名为演示模块。

  • 我把 google-services.json 放在我的演示文稿中/
  • 添加 classpath "com.google.gms:google-services:3.1.0"
  • 添加了插件: apply plugin: 'com.google.gms.google-services'

当我尝试同步 gradle 时,出现错误:

Error:Execution failed for task ':presentation:processDebugGoogleServices'.
No matching client found for package name 'ru.company.acitive.activelife'
Run Code Online (Sandbox Code Playgroud)

我的 build.gradle 片段:

dependencies {
    classpath "com.android.tools.build:gradle:$android_plugin_version"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "com.google.gms:google-services:3.1.0"
}
Run Code Online (Sandbox Code Playgroud)

我的presentation/build.gradle片段:

dependencies {

...

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

Dou*_*son 6

这意味着您的应用程序的应用程序 ID 是“ru.company.acitive.activelife”,但在您的 google-services.json 文件中找不到相同的字符串。

看起来“活跃”的部分有一个错字。它应该是“主动”的吗?