【发布时间】:2019-08-31 13:41:44
【问题描述】:
我正在使用 androidx 支持库,包含用于
的库com.google.android.material:material:1.1.0-alpha05
在构建应用程序时遇到错误,我的应用程序中没有使用任何卡片视图。
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”相同的错误,请帮我解决。
【问题讨论】:
-
你能贴出你的代码吗?
-
你添加
compile 'com.android.support:cardview-v7:25.3.1'这个库了吗 -
能否提供一些代码,可能是你的xml文件和gradle文件
-
我的项目中没有使用任何卡片视图,用我的依赖项更新了问题。
-
您没有使用任何 CardViews?该错误在 style 属性中显示其预期的 cardviews 参数。如果您正在使用卡片视图,请确保您的 RecyclerView 未使用卡片视图。
标签: android material-design androidx