// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven{ url "https://plugins.gradle.org/m2/" } google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:7.0.2' classpath 'com.google.gms:google-services:4.0.1' //这行对谷歌服务库进行依赖 } } //apply plugin: "org.sonarqube" /*plugins { id "org.sonarqube" version "2.7" }*/ allprojects { repositories { google() jcenter() mavenCentral() maven {url 'https://dl.bintray.com/jetbrains/anko'} //这是你需要加入的,这个是解决这个问题的关键地方,我就是添加这个maven后不再报上面的错误了 maven {url "https://maven.google.com"} //谷歌广告 } } task clean(type: Delete) { delete rootProject.buildDir }