gpt4 book ai didi

Android资源链接失败错误: resource style/CardView error: failed linking references

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

我正在使用 androidx 支持库,包括用于

的库

com.google.android.material:material:1.1.0-alpha05

在构建应用程序时出现错误,我没有在我的应用程序中使用任何卡片 View 。

Android resource linking failed

error: resource style/CardView (aka com.app.myapp:style/CardView) not found.
error: style attribute 'attr/cardElevation (aka com.app.myapp:attr/cardElevation)' not found.

error: style attribute 'attr/cardBackgroundColor (aka com.app.myapp:attr/cardBackgroundColor)' not found.

error: style attribute 'attr/cardCornerRadius (aka com.app.myapp:attr/cardCornerRadius)' not found.

error: failed linking references.

已经尝试使用 SO Thread1 , SO Thread2 , SO Thread3

但还没有找到任何解决方案。

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.cardview:cardview:1.0.0' // Included
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.nabinbhandari.android:permissions:3.8'
implementation project(':volley-master')
testImplementation 'junit:junit:4.12'

}

我无法使用与“com.google.android.material”相同的错误的任何 View ,请帮我解决。

最佳答案

首先,尝试删除以下依赖项,因为 com.google.android.material:material:1.1.0-alpha05 已经有了它们,它会自动提取正确的版本。

implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.cardview:cardview:1.0.0'
// Remove it also if you are not using anything from the legacy support library.
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

此外,请确保您已经完成的compileSdkVersion28

解决问题后,您可以根据需要重新尝试使用特定版本。

关于Android资源链接失败错误: resource style/CardView error: failed linking references,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55606764/

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