Android 未能找到'@attr/shapeAppearanceSmallComponent';当前主题
我正在尝试在安卓系统中实现芯片布局,我已经将我的google material dependency更新为最新版本。但是XML文件引发了这个问题Android 未能找到'@attr/shapeAppearanceSmallComponent';当前主题,android,xml,material-design,render,material-components-android,Android,Xml,Material Design,Render,Material Components Android,我正在尝试在安卓系统中实现芯片布局,我已经将我的google material dependency更新为最新版本。但是XML文件引发了这个问题 在当前主题中找不到“@attr/shapeAppearanceSmallComponent”。 梯度锉 allprojects { repositories { google() jcenter() maven { url 'https://jitpack.io'
在当前主题中找不到“@attr/shapeAppearanceSmallComponent”。
梯度锉
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
}
}
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimaryDark</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
所有项目{
存储库{
谷歌()
jcenter()
马文{
url'https://jitpack.io'
}
}
}
@颜色/原色
@颜色/原色暗
@颜色/原色暗
假的
真的
XML文件
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.chip.ChipGroup
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chipGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
android:id="@+id/chip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text" />
</com.google.android.material.chip.ChipGroup>
您可以尝试将基本应用程序主题更改为以下内容:
<style name="Theme.AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
主题中定义了
shapeAppearanceSmallComponent
属性。要使用材质组件库,必须设置主题。材质组件 例如:
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
</style>
如果无法将主题更改为从材质组件主题继承,则还可以使用
主题.MaterialComponents.Bridge
在哪个文件中获得此问题?同时发布您的主题。我在XML文件中得到了这个问题,请检查谢谢您的帮助,您的解决方案运行得很好。很高兴听到这个消息!:)