java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant)
A Material component is used under a non-Material theme.
The style on this component requires your app theme to be Theme.MaterialComponentsTheme.MaterialComponents (or a descendant)MaterialButton theme errorjava.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant). Meaning
Material buttons, text fields and cards need a Material theme. Switch your app theme parent or use the Theme.AppCompat.*.Bridge variant while migrating.
Common causes
- App theme parent is AppCompat only
- Component in a dialog with another theme
- Mixed theme in a ContextThemeWrapper
⚡ Quick fix
- Use Theme.Material3 or Theme.MaterialComponents
- Use the .Bridge theme temporarily
- Apply the Material theme to the dialog too
Detailed fix by platform
XML
<style name="Theme.App" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge"/>
How to diagnose
- Theme — parent?
- Dialog — themed?
- Night — same?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- An instance was deallocated while key value observers were still registered NSInternalInconsistencyException: An instance 0x7f of class Foo was deallocated while key value observers were still registered with it
- Android 12 splash screen shows twice / wrong icon (behavior) Two splash screens appear on Android 12+
- App crashes after restore on a new phone (behavior) crash on first launch after device transfer / Auto Backup
Most viewed in Android
- Could not resolve Gradle: Could not resolve all files for configuration / Could not resolve dependency
- INSTALL_FAILED_USER_RESTRICTED INSTALL_FAILED_USER_RESTRICTED: Install canceled by user (Xiaomi/MIUI, Oppo, Vivo)
- INSTALL_PARSE_FAILED_NO_CERTIFICATES INSTALL_PARSE_FAILED_NO_CERTIFICATES / App not installed as package appears to be invalid
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Nov 2026