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

今天运行项目的时候直接报了个这个错误,我也没干别的啊

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.

解决办法:

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

点击菜单栏Build—>RebuildProject

重新加载一下,再点击运行,就搞定了!

感谢原文作者