Android资源链接失败错误:资源样式/CardView错误:链接引用失败

Android资源链接失败错误:资源样式/CardView错误:链接引用失败,android,material-design,androidx,Android,Material Design,Androidx,我使用androidx支持库,包括 材料:材料: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/car

我使用androidx支持库,包括

材料:材料: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.
已经试过了

但还没有找到任何解决办法

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”的视图。同样的错误,请帮助我解决。

这可能是主题和样式的问题。可能您的某个库希望该样式可用,但却找不到它

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="cardViewStyle">@style/CardView</item>
</style>

@样式/卡片视图

首先,尝试删除以下依赖项,因为
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' 
另外,请确保
编译器dkversion
28,您已经这样做了


解决问题后,如果需要,您可以再次尝试逐个使用特定版本。

您可以发布代码吗?您是否添加了
编译'com.android.support:cardwiew-v7:25.3.1'
此库您可以提供一些代码,可能是您的xml文件和gradle文件我在项目中没有使用任何卡视图,用我的依赖项更新了问题。你没有使用任何CardView吗?该错误在“样式”属性中显示其预期的cardviews参数。如果您使用的是CardView,请确保您的RecyclerView未使用CardView。