java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute

后端 未结 9 1610
囚心锁ツ
囚心锁ツ 2020-12-03 09:34

I have a com.google.android.material.button.MaterialButton component in one of my layout file and I get this error when I am using the latest version of the Material Compone

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 09:53

    Got stucked in this error even if my theme extends Theme.MaterialComponents. I was creating Chips like this :Chip chip = new Chip(getActivity().getBasecontext(), null, R.attr.CustomChipChoice);.

    The solution is to change it to Chip chip = new Chip(getActivity(), null, R.attr.CustomChipChoice);.

    Hope it helps.

提交回复
热议问题