Error:Execution failed for task ':app:preDebugAndroidTestBuild' , when tried to run java program in android studio

后端 未结 14 1265
渐次进展
渐次进展 2021-02-13 03:03

Getting the below error at the time of running java program in android studio.

Error:Execution failed for task \':app:preDebugAndroidTestBuild\'.

<
14条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-13 03:38

    Error:

    Error: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.

    This is due to there is no dependency added to your App build.gradle or might be its an old version. So, add a dependency for annotation support.

    implementation 'com.android.support:support-annotations:27.1.1'
    

    Here I have added annotation version 27.1.1 to solve your error if this is mismatched with different version then change it to the required version.

提交回复
热议问题