在标记为重复之前,请阅读问题。
我正在尝试导入现有的Android Studio项目并且它会遇到任务: Gradle:解决依赖关系':app_debugCompile'
我尝试了所有建议的解决方案:
Android Studio stuck on "Gradle: resolve dependancies '_debugCompile'" or 'detachedConfiguration1'
Gradle cannot resolve dependencies in Android Studio
,包括:
这是我的build.gradle:
buildscript {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
repositories {
mavenCentral()
maven {
url 'http://clinker.47deg.com/nexus/content/groups/public'
}
maven {
url "https://mint.splunk.com/gradle/"
}
maven {
url 'http://repo.spring.io/milestone'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.google.gms.google-services'
android {
lintOptions {
abortOnError false
}
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.myappid"
minSdkVersion 16
targetSdkVersion 23
versionCode 10
versionName "1.0.1"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/notice'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
exclude 'AndroidManifest.xml'
}
productFlavors {
}
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:23.1.1'
compile 'org.androidannotations:androidannotations-api:3.0.1'
apt 'org.androidannotations:androidannotations:3.0.1'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1'
compile 'com.google.code.gson:gson:2.3'
compile 'org.apache.commons:commons-io:1.3.2'
compile "com.splunk.mint:mint:4.2.1"
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.maps.android:android-maps-utils:0.3.4'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
compile 'com.ryanharter.android.tooltips:library:0.0.3'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'org.json:json:20140107'
compile 'com.koushikdutta.ion:ion:2.1.6'
}
同样在依赖项下的build.gradle中,我可以看到警告:'dependencies'无法应用于'(groovy.lang.Closure)'
所以我试过了:
'dependencies' cannot be applied to '(groovy.lang.Closure)'
http://alessio.franceschelli.me/android/fix-gradle-warnings-after-android-studio-1-3-update/
Gradle: 'buildTypes' cannot be applied to groovy.lang.Closure
非常感谢任何帮助!