Skip to content
Advertisement

IllegalArgumentException When trying to use @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox

I am trying to stylize the TextInputLayout with an outline. But when I try to use @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox in style attribute my app crashes with this exception:

JavaScript

Here is the TextInputLayout theme I want to use OutlinedBox

It was working fine but suddenly this error appeared during development

JavaScript

Global App Theme

JavaScript

Advertisement

Answer

As reported in the error:

Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant)

You have to change the app theme to a Material Components Theme like:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement