Android 导入项目编译后报 Failed to resolve: ...

导入项目后编译不通过,gradle报以下错误


错误.png

解决方法:
project下的build.gradle文件,将google()的位置调换一下

buildscript {
    repositories {
        google() //放到这里来
        jcenter()
        // google() 报错
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google() //放到这里来
        jcenter()
      // google() 报错
    }
}

你可能感兴趣的:(Android 导入项目编译后报 Failed to resolve: ...)