gpt4 book ai didi

android - 更新到 API 28 后找不到资源样式/Widget.Design.CoordinatorLayout

转载 作者:行者123 更新时间:2023-11-29 14:43:13 25 4
gpt4 key购买 nike

今天我将我的项目从 API 27 更新到 API 28。在更新之前我没有收到任何错误。在更改 compileSdkVersion 和 buildVersion 后构建 gradle 时出现以下错误。我使用 Kotlin 作为项目的主要编程语言。这是错误:

Execution failed for task ':app:processReleaseResources'.
> Android resource linking failed
Output: /Users/sagarsuri/Downloads/MyProject/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:2778: error: resource style/Widget.Design.CoordinatorLayout (aka com.sagar.myproject:style/Widget.Design.CoordinatorLayout) not found.
/Users/sagarsuri/Downloads/MyProject/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml:4480: error: resource style/Widget.Design.CoordinatorLayout (aka com.sagar.myproject:style/Widget.Design.CoordinatorLayout) not found.
error: failed linking references.

这是我的应用程序模块build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

apply plugin: 'io.objectbox'

androidExtensions {
experimental = true
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.sagar.myproject"
minSdkVersion 21
targetSdkVersion 27
// Enabling multidex support.
multiDexEnabled true
versionCode 11
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.2'
}

ext {
supportLibraryVersion = '28.0.0'
glideLibraryVersion = '4.6.1'
retrofitLibraryVersion = '2.4.0'
rxJavaVersion = '2.1.0'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:support-v13:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"

//Glide library
implementation "com.github.bumptech.glide:glide:$glideLibraryVersion"
kapt "com.github.bumptech.glide:compiler:$glideLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'

//Retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitLibraryVersion"

//RxJava
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"

//ObjectBox
implementation "io.objectbox:objectbox-android:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"

//MaterialDialog
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

//ReactiveNetwork
implementation 'com.github.pwittchen:reactivenetwork-rx2:0.12.3'

//MultiDex
implementation 'com.android.support:multidex:1.0.3'

//Fotoapparat
implementation 'io.fotoapparat.fotoapparat:library:2.2.0'

//ChartView
implementation 'com.github.razerdp:AnimatedPieView:1.2.4'
implementation 'com.leinardi.android:speed-dial:2.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'me.shaohui.advancedluban:library:1.3.5'
implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.0.5'
testImplementation 'junit:junit:4.12'

// implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

请让我知道是什么导致了错误。 Android Studio 的版本是3.2

最佳答案

你试过了吗this answer on SO ?它帮助了我。我有多模块项目。你需要更换

style/Widget.Design.CoordinatorLayout

@style/Widget.Support.CoordinatorLayout

在您所有的 styles.xml 文件中。当我尝试在 AndroidX 上迁移时(不仅更新到 API 28),这个问题发生在我身上

关于android - 更新到 API 28 后找不到资源样式/Widget.Design.CoordinatorLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52566567/

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