问题
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