0
的Android 1.0.2工作室Mac上Android Studio V1.0.2,错误:(2,0)Gradle DSL方法未找到:'compile()'?
当我开始一个新项目gradle这个1.0.0,gradle这个项目同步失败,错误:
Error:(2, 0) Gradle DSL method not found: 'compile()'
Possible causes:<ul><li>The project 'My Application' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
下build.gradle项目
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
下应用的build.gradle
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
}
apply plugin: 'com.android.application' android {
compileSdkVersion 21 buildToolsVersion "21.1.1" defaultConfig {
applicationId "com.macernow.djstava.myapplication" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0"
} buildTypes {
release {
minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
} dependencies {
compile 'com.android.support:appcompat-v7:21.+' compile fileTree(dir: 'libs', include: ['*.jar'])
}
而且我也尝试联机/脱机设置的gradle,错误remains.Please帮助我,谢谢。