我只是升級了android studio和以前編譯的項目現在顯示錯誤!錯誤(19,0)Gradle的DSL方法沒有找到:android()
Error(19,0) Gradle DSL method not found: android()
,這裏是構建腳本和app.build.gradle
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()
}
}
android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
}
productFlavors {
}
}
dependencies {
}
而這裏的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.aqsa.personal.newpro"
minSdkVersion 8
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
刪除應用程序的'allprojects'部分後的所有內容build.gradle – nikis