3

Before marking as a duplicate, please read the question.

I am trying to import existing Android Studio project and it gets stuck at the task: Gradle: Resolve dependencies ':app_debugCompile'

I tried all the solutions advised here:

Android Studio stuck on "Gradle: resolve dependancies '_debugCompile'" or 'detachedConfiguration1'

Gradle cannot resolve dependencies in Android Studio

including:

  • Using default gradle wrapper and using local gradle distribution
  • Invalidate caches / restart
  • Closing / opening / importing existing Android studio project
  • Moving buildTypes to the end of android section in build.gradle
  • updating SDK
  • deleting .gradle folder

Here is my 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'
}

Also in my build.gradle under dependencies I can see the warnings: ‘dependencies’ cannot be applied to ‘(groovy.lang.Closure)’

So I tried:

'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

Very appreciate any help!

Community
  • 1
  • 1
Leo DroidCoder
  • 14,527
  • 4
  • 62
  • 54
  • I had this problem before and spent the whole day to find the solution. My problem was that my android support libraries were damaged so I just had to reinstall them. Not sure if this will help you fix your problem so posted as a comment. – Naheel Mar 17 '16 at 18:32
  • I tried reinstalling support libs, but unfortunately it didn't help. Thanks anyway – Leo DroidCoder Mar 17 '16 at 18:38
  • Can you try invoking it from the command line with the --stacktrace param to see if it prints any helpful info? – Cruceo Mar 17 '16 at 19:24

0 Answers0