• Register
0 votes
106 views

Problem :

I am new to Android. Recently I have installed the Android studio 3.1.3 and it started giving me the dependencies error if tried to make the new project and tried to compile for the first time.

“Unable to resolve dependency for ':app@debug/compileclasspath': could not resolve project”

2.3k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had faced this issue in the past. It is really tough issue to resolve if you don’t have any guidance. I can help you in resolving your error.

Please follow below procedure very carefully to fix your issue.

You need to go to your File->Invalidate Caches / Restart

After this you should clean the .gradle and .idea these directories are present under your project root directory.

Also you need to add the below given Google Maven repository and then you can sync your project

buildscript {
    repositories {
        jcenter()
        google()
        maven {
           url "https://maven.google.com"
        }
    }
       dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        maven {
           url "https://maven.google.com"
        }
    }
}

Currently if you the Android Gradle Plugin 3.1.3 then you update it to version 4.4. Under your root directory of the project, you must update your gradle-wrapper.properties as follows.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Hope it fixed your issue.

5k points