gpt4 book ai didi

android - 所有 com.android.support 库必须使用完全相同的版本规范 : 27. 0.2

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:29:24 26 4
gpt4 key购买 nike

将 targetSdkVersion 更新为 27 后,我收到此错误消息。

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.0.2, 25.2.0. Examples include com.android.support:animated-vector-drawable:27.0.2 and com.android.support:support-media-compat:25.2.0

我知道我应该更新 com.android.support:support-media-compat 但我不知道该怎么做,因为我没有在 build.gradle 中使用它,我尝试更新 SDK 工具但是问题仍然存在。下面是 build.gradle:

    apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.ex"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bloder:magic:1.1'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
}

最佳答案

我手动检查了 project -> .myidea-> libraries 中的库,然后我发现我有两个使用旧版本的库:

com_android_support_support_media_compat_25_2_0 com_android_support_support_v4_25_2_0

然后只需在 builde.gradle 中添加这一行

implementation 'com.android.support:support-v4:27.0.2'

现在错误消失了。

关于android - 所有 com.android.support 库必须使用完全相同的版本规范 : 27. 0.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47814814/

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