Skip to content

[Android] Java.Lang.IllegalArgumentException: 'This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).' #31703

@Natriss

Description

@Natriss

Description

Sometimes it works but most of the times it doesn't.
It is also really inconsistent with the error.
When I want to test a .NET MAUI - .NET 10 RC 1 with a label it gives the error Java.Lang.IllegalArgumentException: 'This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).'.
Then I clean the solution and remove both bin and obj folders and then it works again for 2 or 3 times. Hot reload will also work.
But if I end it and rebuild/deploy and use the debugger again it can result in the same result.
I can remove all attributes like fontsize, maxlines, linebreakmode, etc and it could still fail.
Even when I remove the Labels I still get this error.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

10.0.0-rc.1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.90 SR9

Affected platforms

Android

Affected platform versions

Android 16

Did you find any workaround?

Every time I want to build it for android I do Clean solution and then Rebuild solution.
Then if I run it with the debugger it works until it breaks and I redo this.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions