0

I am following an online course on Android Development but I am stuck at the very beginning since I get a dependcy issue with Gradle which prevents me from successfully building example projects. The error is the famous:

Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

My Gradle is below:

// 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 {
        google()
        jcenter()
    }
}

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

As suggested by the lecturer, I am using AS 3.0.1. However, the lecturer has not been able to solve this issue for me and since I am totally new with AS I have no idea how to proceed.

Any help would be appreciated!

Many thanks, Alberto

  • https://stackoverflow.com/a/50157698/9808588 Check this question out, the answer might solve your question. – steveOS Dec 24 '19 at 21:40
  • please add your Gradle file as well in your question – Mouaad Abdelghafour AITALI Dec 24 '19 at 23:18
  • Dear O. Steve, Many thanks for your answer. I have tried all the solutions in that answer, but none worked. @Mouaad: my gradle file is in the original question (build.gradle). Thanks all! Alberto – Giulio Severini Dec 27 '19 at 20:28
  • Hi, for those who encounter my same problem a simple REBUILD of the project fixes everything. So, go on top menu, click on BUILD and then REBUILD PROJECT. Thanks, Alberto – Giulio Severini Jan 01 '20 at 21:51

0 Answers0