gpt4 book ai didi

java - 所有 com.android.support 库和 SDK 版本都必须相同、更高还是更低?

转载 作者:行者123 更新时间:2023-12-02 02:07:24 24 4
gpt4 key购买 nike

如果你看看我的 2 个库(support:appcompat-v7:24.2.1 和 support:design:25.3.1),它是一条红线,上面写着“这个库不应该使用不同的版本(25 )而不是compileSDKVersion(24)。我应该将我的SDK更改为更高版本还是将我的支持库更改为低于SDK或高于SDK?

android {
compileSdkVersion 24
buildToolsVersion "27.0.3"
lintOptions{
abortOnError false
}
defaultConfig {
applicationId "com.sangabriel.myrealapp"
minSdkVersion 23
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {

// Firebase
compile 'com.google.firebase:firebase-core:16.0.0'

compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'

// Design library for Coordinator Layout and Toolbars
compile 'com.android.support:design:25.3.1'

最佳答案

是的,当您使用任何谷歌或核心库时,其所有版本都应该相同。

In your case you can do two things. Your compileSdkVersion is 24 So that you can use either of these two things

  1. You can change all your library/dependancy version to 24.2.1 as compileSdkVersion

  2. You can change all your library/dependancy version to 25.3.1 to newer version

示例

1.案例一

compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'

2.案例二

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'

关于java - 所有 com.android.support 库和 SDK 版本都必须相同、更高还是更低?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50561940/

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