出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法

在dependencies中添加
androidTestCompile('com.android.support:support-annotations:26.1.0') {
force = true
}

 添加后的效果:

原文地址:https://www.cnblogs.com/zhangxinyue/p/13411960.html