完整报错:Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (22.2.1) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
方案一:把androidTestImplementation改成implementation
方案二:如果不用runner和espresso-core这两个依赖就直接删除
方案三:把runner和espresso-core的版本改成app对应的版本
方案四:提高appcompat版本与testapp的一致
方案五:build.gradle里面添加下面代码,告诉test app 以app的版本号为主
configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:27.1.1' }