gpt4 book ai didi

java - 数据绑定(bind)插件使用旧版本的支持库

转载 作者:行者123 更新时间:2023-11-29 04:22:01 25 4
gpt4 key购买 nike

将支持库更新到 27.0.2 后出现此错误。

Error:Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:support-v4' has different version for the compile (21.0.3) and runtime (27.0.2) classpath. You should manually set the same version via DependencyResolution

我在我的项目中启用了数据绑定(bind)。

dataBinding.enabled = true

当我运行时

gradlew -q dependencies app:dependencies --configuration debugAndroidTestCompileClasspath

这是我得到的:

+--- com.android.databinding:library:1.3.1
| +--- com.android.support:support-v4:21.0.3
| | \--- com.android.support:support-annotations:21.0.3 -> 26.0.2
| \--- com.android.databinding:baseLibrary:2.3.0-dev -> 3.0.1
+--- com.android.databinding:baseLibrary:3.0.1
+--- com.android.databinding:adapters:1.3.1
| +--- com.android.databinding:library:1.3 -> 1.3.1 (*)
| \--- com.android.databinding:baseLibrary:2.3.0-dev -> 3.0.1
+--- com.squareup.leakcanary:leakcanary-android:1.5.1
| \--- com.squareup.leakcanary:leakcanary-analyzer:1.5.1
| +--- com.squareup.haha:haha:2.0.3
| \--- com.squareup.leakcanary:leakcanary-watcher:1.5.1
+--- project :general
| +--- com.android.databinding:library:1.3.1 (*)
| +--- com.android.databinding:baseLibrary:3.0.1
| \--- com.android.databinding:adapters:1.3.1 (*)
+--- com.jakewharton:butterknife:8.8.1
| \--- com.jakewharton:butterknife-annotations:8.8.1
+--- com.github.bumptech.glide:glide:4.2.0
| +--- com.github.bumptech.glide:gifdecoder:4.2.0
| | \--- com.android.support:support-annotations:26.0.2
| +--- com.github.bumptech.glide:disklrucache:4.2.0
| \--- com.github.bumptech.glide:annotations:4.2.0
\--- com.github.apl-devs:appintro:v4.2.2

这清楚地表明 Android 数据绑定(bind)库正在使用版本 21.0.3 的 v4 支持,这会导致冲突。

有人能帮忙吗?

最佳答案

将其添加到您的dependencies 闭包中:

  implementation "com.android.support:support-v4:26.0.2"

这将导致 Gradle 升级 support-v4 依赖项以匹配您的支持库 Artifact 的其余部分。

关于java - 数据绑定(bind)插件使用旧版本的支持库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48517972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com