您的位置:首页 > 移动开发 > Android开发

Gradle DSL method not found

2018-01-12 15:41 155 查看
Gradle DSL method not found: ‘android()’

去掉根目录的build.gradle中的

android {

compileSdkVersion 23

buildToolsVersion “23.0.3”

}

Gradle DSL method not found: ‘google()’

方法1:

在gradle-wrapper.properties 设置distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

在根目录中的build.grale中设置

dependencies {classpath ‘com.android.tools.build:gradle:3.0.1’ }

方法2:

在根目录中的

repositories {

google()

}

替换成

repositories {

maven {

url ‘https://maven.google.com

}

}

Gradle Dsl method not found:‘ compile()’

去掉根目录的build.gradle中的

dependencies {

compile fileTree(include: [‘*.jar’], dir: ‘libs’)

testCompile ‘junit:junit:4.12’

compile ‘com.android.support:appcompat-v7:23.2.0’

compile ‘com.android.support:design:23.2.0’

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  androidStudio