CHGamer
CHGamer

Reputation: 57

Gradle Sync Failed; Unable to resolve dependency

So I'm facing this issue when opening my project, when it tries to sync gradle, it fails with bunch of errors just like this:

C:\Users\chgam\AndroidStudioProjects\Clicker\app\build.gradle
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'a2e1c0f0b1f12751de0faef0779845e8' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;a2e1c0f0b1f12751de0faef0779845e8&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file '2fb0769f609abbf071245de47adfd63b' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;2fb0769f609abbf071245de47adfd63b&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file '813170e4070acd24750321f2d7aa30c6' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;813170e4070acd24750321f2d7aa30c6&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file '02724237b02d3406161e468d55d0060f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;02724237b02d3406161e468d55d0060f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'df60192a7dbbce1d6e7507d3af3eb98f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;df60192a7dbbce1d6e7507d3af3eb98f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'b068e4e90592ef8aaca000867ae570aa' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Failed to transform file &#39;b068e4e90592ef8aaca000867ae570aa&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file '514da6f0413adfbef88c6938d6426983' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;514da6f0413adfbef88c6938d6426983&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file '723f5eb711364787317896adc48eee21' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;723f5eb711364787317896adc48eee21&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'a2e1c0f0b1f12751de0faef0779845e8' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;a2e1c0f0b1f12751de0faef0779845e8&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file '2fb0769f609abbf071245de47adfd63b' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;2fb0769f609abbf071245de47adfd63b&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file '813170e4070acd24750321f2d7aa30c6' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;813170e4070acd24750321f2d7aa30c6&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file '02724237b02d3406161e468d55d0060f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;02724237b02d3406161e468d55d0060f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'df60192a7dbbce1d6e7507d3af3eb98f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;df60192a7dbbce1d6e7507d3af3eb98f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'b068e4e90592ef8aaca000867ae570aa' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;b068e4e90592ef8aaca000867ae570aa&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'espresso-idling-resource-3.0.1.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Failed to transform file &#39;espresso-idling-resource-3.0.1.aar&#39; to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'a2e1c0f0b1f12751de0faef0779845e8' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;a2e1c0f0b1f12751de0faef0779845e8&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file '2fb0769f609abbf071245de47adfd63b' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;2fb0769f609abbf071245de47adfd63b&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file '813170e4070acd24750321f2d7aa30c6' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;813170e4070acd24750321f2d7aa30c6&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file '02724237b02d3406161e468d55d0060f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;02724237b02d3406161e468d55d0060f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'df60192a7dbbce1d6e7507d3af3eb98f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;df60192a7dbbce1d6e7507d3af3eb98f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'b068e4e90592ef8aaca000867ae570aa' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Failed to transform file &#39;b068e4e90592ef8aaca000867ae570aa&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'a2e1c0f0b1f12751de0faef0779845e8' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;a2e1c0f0b1f12751de0faef0779845e8&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file '2fb0769f609abbf071245de47adfd63b' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;2fb0769f609abbf071245de47adfd63b&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file '813170e4070acd24750321f2d7aa30c6' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;813170e4070acd24750321f2d7aa30c6&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file '02724237b02d3406161e468d55d0060f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;02724237b02d3406161e468d55d0060f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'df60192a7dbbce1d6e7507d3af3eb98f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;df60192a7dbbce1d6e7507d3af3eb98f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'b068e4e90592ef8aaca000867ae570aa' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Failed to transform file &#39;b068e4e90592ef8aaca000867ae570aa&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'a2e1c0f0b1f12751de0faef0779845e8' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;a2e1c0f0b1f12751de0faef0779845e8&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file '2fb0769f609abbf071245de47adfd63b' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;2fb0769f609abbf071245de47adfd63b&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file '813170e4070acd24750321f2d7aa30c6' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;813170e4070acd24750321f2d7aa30c6&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file '02724237b02d3406161e468d55d0060f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;02724237b02d3406161e468d55d0060f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'df60192a7dbbce1d6e7507d3af3eb98f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;df60192a7dbbce1d6e7507d3af3eb98f&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>
    Error:Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'b068e4e90592ef8aaca000867ae570aa' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:C:/Users/chgam/AndroidStudioProjects/Clicker/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Failed to transform file &#39;b068e4e90592ef8aaca000867ae570aa&#39; to match attributes {artifactType=jar} using transform AarTransform">Show Details</a>

Project/ build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {

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


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

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }

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

App / build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "ga.venico.clicker"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

As far I've tried things like playing with the settings, deleting .gradle file multiple times, and basically anything I've found on searching google.

Does anyone have an idea on why this has happened and how to resolve it? This happened after saving my project and building my project and closing my pc and then trying to open it the next day.

Upvotes: 4

Views: 5944

Answers (2)

Sneh Pandya
Sneh Pandya

Reputation: 8463

  1. Make sure your machine is connected to the internet.
  2. Go to File -> Settings & expand Build, Execution, Deployment -> Gradle -> UNCHECK Offline work -> OK
  3. Go to File -> click on Invalidate Caches / Restart -> Invalidate & Restart

Upvotes: 1

Goku
Goku

Reputation: 9692

Try this

compileSdkVersion 26
buildToolsVersion "26.1.0"

Upvotes: 2

Related Questions