其他分享
首页 > 其他分享> > 我是否可以忽略“不兼容的Gradle版本”棉绒检查,如果Gradle覆盖了Transtivie依赖项?

我是否可以忽略“不兼容的Gradle版本”棉绒检查,如果Gradle覆盖了Transtivie依赖项?

作者:互联网

我只是违反了此皮棉检查:

Incompatible Gradle Versions ../../build.gradle: All
com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 25.3.1, 25.2.0. Examples include
com.android.support:animated-vector-drawable:25.3.1 and
com.android.support:support-v13:25.2.0

我的某些传递依赖项肯定不会更新为最新的支持版本.但是,我在我的应用程序build.gradle文件中以最新版本将支持库设置为第一级依赖项.我什至可以看到Gradle覆盖了所有这些依赖项:

$./gradlew app:dependencies | grep 25.2.0

|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    +--- com.android.support:support-v13:25.2.0
|    |    +--- com.android.support:support-annotations:25.2.0 -> 25.3.1
|    |    \--- com.android.support:support-v4:25.2.0 -> 25.3.1 (*)
|    \--- com.android.support:design:25.2.0 -> 25.3.1 (*)

我有什么需要担心的,还是可以安全地忽略此皮棉错误?

解决方法:

它并没有覆盖每个依赖项:com.android.support:support-v13:25.2.0未更新为25.3.1.

您应该添加编译“ com.android.support:support-v13:25.3.1”,以确保所有内容都在同一版本上.

标签:android-lint,gradle,lint,android
来源: https://codeday.me/bug/20191111/2019895.html