在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 https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
解决办法:在 APP build.gradle 添加
可以参考这个 https://blog.csdn.net/yikunhan/article/details/8009603
1 android { 2 ... 3 } 4 5 configurations.all { 6 resolutionStrategy.force 'com.android.support:support-annotations:27.1.1' 7 } 8 9 dependencies { 10 ... 11 }