Skip to content Skip to sidebar Skip to footer

Gradle - Failed To Resolve

I know there are multiple threads on this already but not a single fix worked so I figured I must have a unique issue or be making a stupid error that someone smart can point out.

Solution 1:

in the build.gradle file inside android {}, add this line

dexOptions {
    javaMaxHeapSize "4g"
}

like

android {
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

if its still not building, you might have to enable multidex

Look at this Stack Overflow post for how to enable multidex

gradle - Android Studio build too slow multidex application

Solution 2:

I faced the same issue and resolved by adding maven repository URL like this

android{
    repositories{
       maven{
          url 'http://repo1.maven.org/maven2'
       }
    }
}

Hope this might helps you.

Solution 3:

I had the same problem. Solved it by adding below code to build.gradle

allprojects {
   repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
    jcenter()
      }
  }

Post a Comment for "Gradle - Failed To Resolve"