Gradle sync failed: Gradle DSL method not found: 'compile()'
app gradle是:
apply plugin: 'com.android.application'
android {
enforceUniquePackageName = false
compileSdkVersion android_compile_version
buildToolsVersion android_version
defaultConfig {
minSdkVersion android_min_sdk_version
targetSdkVersion android_compile_version
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:${appcompat_library_version}"
compile "com.android.support:support-v4:${support_library_version}"
compile project(':libraries:BaseGameUtils')
compile 'com.google.android.gms:play-services:4.3.23'
}
buildscript {
repositories {
jcenter()
}
}
和项目gradle:
// this is the parent build configuration for all the sample projects.
// for more information on gradle build files when used in a multi-project build, see
// http://gradle.org/docs/current/userguide/multi_project_builds.html
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
// allprojects apply to every project
allprojects {
repositories {
jcenter()
}
ext {
android_compile_version = 23
android_version = '23.0.1'
android_min_sdk_version = 9
appcompat_library_version = '23.0.1'
support_library_version = '23.0.1'
gms_library_version = '8.1.0'
}
}