Android studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'错误的解决办法

Android studio新建工程后出现如下错误

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 

解决办法:在 build.gradle 添加

?

1

2

3

4

5

6

7

8

9

10

11

android {

 ...

}

configurations.all {

 resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'

}

dependencies {

 ...

}

转自:https://www.2cto.com/kf/201807/760034.html

猜你喜欢

转载自blog.csdn.net/b1480521874/article/details/85237320