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.

前端 未结 15 1501
臣服心动
臣服心动 2020-12-02 05:46

I am new to Android App Development. When I tried to create a new project,Android Project...the following message popped up..

Error:Execution failed for task \':app:

15条回答
  •  既然无缘
    2020-12-02 05:53

    Don't worry It is simple:

    Go to the "Project" Directory structure and in that go to "Gradle Scripts" and inside it go to "build.gradle (Module:app)" and double click it.

    Now - Scroll down the program and in that go to the dependencies section : Like below


    dependencies {

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

    }


    Now in this Delete the last two lines of code and rebuild the app and now it will work

    The dependencies should be:


    dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    

    }


    REBUILD THE APP AND IT WORKS !!

提交回复
热议问题