Toton
Toton

Reputation: 43

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.1.1

Note. This not duplicate of this question but the extension as there are few more error I got and the solution in that question stated was not solving my errors.

Problem: Recently I am migrating my older project to upper version. I have updated Android Studio to 3.1 and Using API 27 with Gradle 4.4. I have changed the depricated compile to implementation now I am facing a very weird error. I am telling weird as I have tried many solution stated in other question and answers but nothing helped me. Beside the :app@debug/compileClasspath I am getting also the following errors

:app@debugAndroidTest/compileClasspath
:app@debugUnitTest/compileClasspath
:app@release/compileClasspath
:app@releaseUnitTest/compileClasspath

I think all errors are related. I am getting this long list of error with every libraries.

Here is my app build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.epp.app.myproject"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
    maven { url uri('https://jitpack.io') }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven {url uri('https://oss.sonatype.org/content/repositories/snapshots/')}
    google()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    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'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.github.rey5137:material:1.2.4'
    implementation 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
    implementation 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
    implementation 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.1.0'
    implementation 'com.github.gabrielemariotti.cards:cardslib-extra-staggeredgrid:2.1.0'
    implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0'
    implementation 'devlight.io:navigationtabbar:1.2.5'
    implementation('com.mikepenz:materialdrawer:6.0.7@aar') {
        transitive = true
    }
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.github.Netural:RemoteAppControl:1.0.0'
    implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}

Here is my module build.gradle

buildscript {

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

allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}

repositories {
    jcenter()
    mavenCentral()
    google()
}

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

Upvotes: 1

Views: 1792

Answers (1)

Toton
Toton

Reputation: 43

I have found a solution for this. There was a repository conflict. Removing mavenCentral() from buildScript of module build.gradle works like a wonder.

Upvotes: 1

Related Questions