新建项目时出现以下报错内容
报错内容
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.
解决
gradle(app)中
1.在dependencies修改图中红框1处的版本号为27.1.1(看报错信息,它要什么你就给它什么)
2.修改compileSdkVersion为27,与1处对应
3.(可以不改!!) 修改minSdkVersion和targetSdkVersion
最后注意要点一下右上角的Sync