我的项目刷新失败,并出现以下 gradle 脚本的错误:错误:找不到名为“compile”的配置。
//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.google.gms.google-services'
最佳答案
从 project/build.gradle 中删除 apply plugin: 'com.google.gms.google-services' 并将其放入您的 app/build.gradle
apply plugin: 'com.android.application'
android {
...
..
}
dependencies {
....
..
}
apply plugin: 'com.google.gms.google-services'
关于安卓工作室 Gradle : Error:Configuration with name 'compile' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44867212/