新创建的android工程,在构建的时候提示:
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.
网上找了各种方式:
1. Build-->Rebuild Project (该方法只能当时有效,重启androidstudio 或者新建文件的时候都会重新报这个错误)
2. 打开当前build.gradle文件在dependencies (推荐此办法)
下增加:
androidTestCompile('com.android.support:support-annotations:26.1.0') { force = true }