How to Solve Android Studio Conflict with dependency ‘com.android.support:support-annotations’ error
When creating a new project in Android Studio, this error is reported.
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.
Workaround: Add the following to build.gradle
android {
...
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}
dependencies {
...
}
I hope I can help you
Similar Posts:
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- To solve the version compatibility problem of support library: the support package has a red underline when it is introduced
- Android Studio compilation: Program type already present: XXX solution
- [Solved] Android Bug: Error:com.android.dex.DexException: Multiple dex files define Landroid/support/design…
- Android Studio: Could not download junit.jar (junit:junit:4.12)
- About fluent reference image_ Error reported by picker plug-in
- Could not find com.android.tools.build:gradle:3.3.0.
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Using Maven helper to resolve Maven plug-in conflicts
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler