Error Conflict with dependency in android studio

喜夏-厌秋 提交于 2019-12-11 05:03:57

问题


I am getting this error in android studio when i try to create a new project. Please help me step to step to deal with it. I am completely new to this IDE. ERROR SCREENSHOT

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:


I found the solution myself, I'd like to leave it here.

Open android studio. On the left side that project menu (files explorer type) there will be a option "gradle scripts" clicking on it opens the drop down menu.

There will be a file build.gradle (Module:app) Double click it, It would open in android studio.

Change to the following in settings: compileSdkVersion 27 targetSdkVersion 27 implementation 'com.android.support:appcompat-v7:27.1.1'

Sync the files in gradle. You're done. Android studio would download the files if required.



来源:https://stackoverflow.com/questions/50334435/error-conflict-with-dependency-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!