这是我的项目build.gradle:
buildscript {
...
dependencies {
...
classpath 'com.google.gms:google-services:3.1.0'
}
}
在模块的 build.gradle 之一中,我有这个:
apply plugin: 'com.google.gms.google-services'
导致以下错误:
Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension.
有趣的是,如果我将 google-services
版本设置为 3.0.0
,这个特定错误就会消失,但是 Gradle 要求我降级其他 google 库的版本,但是我真的不想那样做。
我如何处理这些LibraryVariants
?
最佳答案
您只在 app 模块中设置了 apply plugin: 'com.google.gms.google-services'
,而没有在其他模块中设置。
关于java - 无法应用插件 "com.google.gms.google-services",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45092308/