gpt4 book ai didi

android - 所有 com.android.support 库必须使用准确的版本

转载 作者:行者123 更新时间:2023-11-29 19:18:59 26 4
gpt4 key购买 nike

我遇到了这个问题

All com.android.support libraries must use the exact same version specification (mixing version can lead to runtime crashes). Found versions 24.0.0, 23.4.0, 23.1.1. Examples include com.android.support:support-v4:24.0.0 and com.android.support:cardview-v7:23.4.0

我一直在阅读它herehere

根据我收集到的信息,我可以使用以下方法找到“偏移版本”

./gradlew -q dependencies app:dependencies --configuration compile

然后上面的结果是:

compile - Classpath for compiling the main sources.
+--- project :library
| \--- com.android.support:support-v4:23.1.1 -> 24.0.0
| \--- com.android.support:support-annotations:24.0.0
+--- com.google.android.gms:play-services-auth:9.8.0
| +--- com.google.android.gms:play-services-auth-base:9.8.0
| | +--- com.google.android.gms:play-services-base:9.8.0
| | | +--- com.google.android.gms:play-services-basement:9.8.0
| | | | \--- com.android.support:support-v4:24.0.0 (*)
| | | \--- com.google.android.gms:play-services-tasks:9.8.0
| | | \--- com.google.android.gms:play-services-basement:9.8.0 (*)
| | \--- com.google.android.gms:play-services-basement:9.8.0 (*)
| +--- com.google.android.gms:play-services-base:9.8.0 (*)
| \--- com.google.android.gms:play-services-basement:9.8.0 (*)
+--- com.facebook.android:facebook-android-sdk:4.13.1
| +--- com.parse.bolts:bolts-android:1.4.0
| | +--- com.parse.bolts:bolts-tasks:1.4.0
| | \--- com.parse.bolts:bolts-applinks:1.4.0
| | \--- com.parse.bolts:bolts-tasks:1.4.0
| +--- com.android.support:customtabs:23.4.0
| | +--- com.android.support:support-annotations:23.4.0 -> 24.0.0
| | \--- com.android.support:support-v4:23.4.0 -> 24.0.0 (*)
| +--- com.android.support:support-v4:23.4.0 -> 24.0.0 (*)
| \--- com.android.support:cardview-v7:23.4.0
+--- com.google.code.gson:gson:2.3
+--- com.android.support:appcompat-v7:23.1.1
| \--- com.android.support:support-v4:23.1.1 -> 24.0.0 (*)
+--- com.google.gms:google-services:3.0.0
+--- com.koushikdutta.ion:ion:2.+ -> 2.1.9
| +--- com.google.code.gson:gson:2.3
| \--- com.koushikdutta.async:androidasync:2.1.9
+--- com.ivankocijan:MagicViews:1.0.4
+--- com.nineoldandroids:library:2.4.0
+--- com.android.support:multidex:1.0.0
+--- com.crashlytics.sdk.android:crashlytics:2.6.6
| +--- io.fabric.sdk.android:fabric:1.3.15
| +--- com.crashlytics.sdk.android:beta:1.2.3
| | \--- io.fabric.sdk.android:fabric:1.3.15
| +--- com.crashlytics.sdk.android:answers:1.3.11
| | \--- io.fabric.sdk.android:fabric:1.3.15
| \--- com.crashlytics.sdk.android:crashlytics-core:2.3.15
| +--- io.fabric.sdk.android:fabric:1.3.15
| \--- com.crashlytics.sdk.android:answers:1.3.11 (*)
+--- com.crashlytics.sdk.android:crashlytics-ndk:1.1.5
| +--- io.fabric.sdk.android:fabric:1.3.14 -> 1.3.15
| \--- com.crashlytics.sdk.android:crashlytics-core:2.3.13 -> 2.3.15 (*)
\--- com.google.firebase:firebase-core:9.8.0
\--- com.google.firebase:firebase-analytics:9.8.0
+--- com.google.android.gms:play-services-basement:9.8.0 (*)
+--- com.google.firebase:firebase-common:9.8.0
| +--- com.google.android.gms:play-services-basement:9.8.0 (*)
| \--- com.google.android.gms:play-services-tasks:9.8.0 (*)
\--- com.google.firebase:firebase-analytics-impl:9.8.0
+--- com.google.android.gms:play-services-basement:9.8.0 (*)
+--- com.google.firebase:firebase-iid:9.8.0
| +--- com.google.android.gms:play-services-basement:9.8.0 (*)
| \--- com.google.firebase:firebase-common:9.8.0 (*)
\--- com.google.firebase:firebase-common:9.8.0 (*)

Gradle :

enter image description here

我的问题是。

即使我现在找到了错误版本的依赖项,我该如何更改它?

我尝试使用正确的版本编译它们,但警告仍然存在。

最佳答案

您应该使用相同的 compileSdkVersionbuildToolsVersion 作为支持库例如

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:palette-v7:24.2.0'
}

你可以在这里看到 Support Library,compiledSdkVersionbuildToolsVersion 使用相同的版本。只需尝试一下,看看它是否能解决您的问题。

关于android - 所有 com.android.support 库必须使用准确的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42872130/

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