こんにちは、Android Studio の初心者です。Android Studio 1.4 から 2.1 にアップデートした後、プロジェクトを同期しようとすると、次のビルド エラーが発生します。
Gradle sync failed: Gradle DSL method not found: 'classpath()'
ここにbuild.gradleがあります:
apply plugin:'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "android.arisa.---------"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
//multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
transitive = true
}
compile('com.afollestad.material-dialogs:commons:0.8.1.0@aar') {
transitive = true
}
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
//compile 'com.android.support:multidex'
//compile 'com.mcxiaoke.volley:library-aar:1.0.0'
//compile 'com.mcxiaoke.volley:library:1.+'
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/.idea/libraries/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/libraries/jsoup-1.8.3.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}
repositories {
jcenter()
}
//repositories {
// maven { url "https://jitpack.io" }
//}
gradle-wrapper.properties は次のとおりです。
#Sat Apr 30 11:59:41 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
どうすればこれを修正できますか? (助けてください)
編集:グレードを編集した後、私のAndroidグラドルは次のとおりです。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "android.arisa.kalahroodfinal"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
transitive = true
}
compile('com.afollestad.material-dialogs:commons:0.8.1.0@aar') {
transitive = true
}
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/.idea/libraries/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/libraries/jsoup-1.8.3.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}
しかし、私は新しいエラーがあります:
Error:(43, 13) Failed to resolve: com.afollestad.material-dialogs:commons:0.8.1.0
Error:(40, 13) Failed to resolve: com.afollestad.material-dialogs:core:0.8.1.0