grade sync failed when i want to import a project

Refresh

March 2019

Views

318 time

1

i want to import a project in to android studio but i have an error gradle sync failed .

this is my build.gradle file:

buildscript {
    repositories {
        jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Gradle sync failed: Cause: com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V Consult IDE log for more details (Help | Show Log)

i changed the distributionUrl but doesn't solve the problem .

enter image description here

my gradle-wrapper propertice:

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

i searched the net for 3-4 hours but there was no solution for my problem that can solve my problem .

1 answers

2

Надеюсь, что это работает Файл → Настройки → Сборка, выполнение, развертывание → Instant Run и снимите флажок Включить Instant Run.