targetSDK 28 应该使用什么版本的支持库?
What support library version should we use with targetSDK 28?
我正在浏览这个 article ,它对 update your project's compileSdkVersion and targetSdkVersion to API 28
说。所以我做了,但是支持库给出了错误,比如支持库不应该使用与 compileSdk 版本
不同的版本
我尝试将它更新到 28.0.0 但它不起作用并说
Failed to resolve: com.android.support:appcompat-v7:28.0.0
我知道它仍然可以与 27.1.1
一起使用,但正确的版本是什么,不会给出红色下划线?
编辑
build.gradle 文件
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "in.eightfolds.safety"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
ext.support_version = '28.0.0'
ext.room_version = "1.1.1"
ext.lifecycle_version = "1.1.1"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
kapt 'com.android.databinding:compiler:3.1.3'
//Room (remove apply plugin: 'kotlin-kapt' at top)
implementation "android.arch.persistence.room:runtime:$room_version"
kapt "android.arch.persistence.room:compiler:$room_version"
implementation "com.android.support:design:$support_version"
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.6.1' // for Kotlin
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.pddstudio:encrypted-preferences:1.3.0'
implementation 'com.nabinbhandari.android:permissions:3.6'
implementation 'com.google.code.gson:gson:2.8.4'
}
//below part of code credit to
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion "$support_version"
}
}
}
}
您可以将 Revision 28.0.0 Alpha 1
用于 android p
但它是预览版
访问https://developer.android.com/topic/libraries/support-library/packages获取最新的支持库
我知道这已经得到回答,但我今天也需要更新我的,上面答案中的链接都没有告诉我要放什么。所以我不得不使用以下内容:
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:animated-vector-drawable:28.0.0-rc01'
implementation 'com.android.support:support-v4:28.0.0-rc01'
implementation 'com.android.support:support-media-compat:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
我希望这可以帮助其他人寻找放在那里的东西。
我正在浏览这个 article ,它对 update your project's compileSdkVersion and targetSdkVersion to API 28
说。所以我做了,但是支持库给出了错误,比如支持库不应该使用与 compileSdk 版本
我尝试将它更新到 28.0.0 但它不起作用并说
Failed to resolve: com.android.support:appcompat-v7:28.0.0
我知道它仍然可以与 27.1.1
一起使用,但正确的版本是什么,不会给出红色下划线?
编辑
build.gradle 文件
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "in.eightfolds.safety"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
ext.support_version = '28.0.0'
ext.room_version = "1.1.1"
ext.lifecycle_version = "1.1.1"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
kapt 'com.android.databinding:compiler:3.1.3'
//Room (remove apply plugin: 'kotlin-kapt' at top)
implementation "android.arch.persistence.room:runtime:$room_version"
kapt "android.arch.persistence.room:compiler:$room_version"
implementation "com.android.support:design:$support_version"
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.6.1' // for Kotlin
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.pddstudio:encrypted-preferences:1.3.0'
implementation 'com.nabinbhandari.android:permissions:3.6'
implementation 'com.google.code.gson:gson:2.8.4'
}
//below part of code credit to
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion "$support_version"
}
}
}
}
您可以将 Revision 28.0.0 Alpha 1
用于 android p
但它是预览版
访问https://developer.android.com/topic/libraries/support-library/packages获取最新的支持库
我知道这已经得到回答,但我今天也需要更新我的,上面答案中的链接都没有告诉我要放什么。所以我不得不使用以下内容:
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:animated-vector-drawable:28.0.0-rc01'
implementation 'com.android.support:support-v4:28.0.0-rc01'
implementation 'com.android.support:support-media-compat:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
我希望这可以帮助其他人寻找放在那里的东西。