-
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
android studio更新后创建新项目时出现以下错误
可以用Build->Rebuild Project解决,但这个方法只是临时的,重新打开项目还是会报错
所以用另一种方法:
在app下的build.gradle文件中的dependences {}中添加如下代码:
androidTestCompile('com.android.support:support-annotations:26.1.0') { force = true } 添加后截图: