Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle加上这个库后,com.google.android.material.chip.Chip使用的地方报异常 #469

Closed
goodluckier opened this issue Jun 19, 2020 · 2 comments

Comments

@goodluckier
Copy link

goodluckier commented Jun 19, 2020

本来chip用的好好,刚发现加上这个库就闪退了,报

android.view.InflateException:Binary XML file line #9 in com.ruanmei.ithome:layout/list_item_keyword_view: Binary XML file line #9 in com.ruanmei.ithome:layout/list_item_keyword_view: Error inflating class com.google.android.material.chip.Chip

2 ......
3 Caused by:
4 java.lang.IllegalArgumentException:The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
5 com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
6 com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)

上网查后给chip加上android:theme="@style/Theme.MaterialComponents"就好了,就是点击效果变了。

看了源码gradle,发现material:1.3.0-alpha01,而我的是1.0.0,所以才这样。

@junixapp
Copy link
Owner

你可以配置gradle只使用你的版本

@goodluckier
Copy link
Author

@li-xiaojun 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants