解決Android Studio Conflict with dependency 'com.android.support:support-annotations'報錯

QQ截圖20190509115335.png

粘貼一點gradle console的日志

* What went wrong:
Execution failed for task ':paydemo:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':paydemo'. 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.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 40s

在Android Studio 創建新項目的時候,出現這個報錯:

解決辦法:在app的 build.gradle 添加

android {
    ...
}

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}

dependencies {
    ...
}

resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'可以修改與v7包版本一致即可,不一定要27.1.1。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。