Skip to content

[MaterialAlertDialogBuilder] MaterialAlertDialogBuilder crashes because of Theme #1229

@shaikfaizal

Description

@shaikfaizal

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

Expected behavior: shouldn't crash

Source code: MaterialAlertDialogBuilder(activity)
.setTitle(R.string.logout_title)
.setMessage(R.string.logout_message)
.setPositiveButton(R.string.logout_positive_btn_label, null)
.setNegativeButton(R.string.logout_negative_btn_label, null)
.create()

Theme:<style name="Theme.MyApp" parent="Base.Theme.MyApp" />
@style/ThemeOverlay.App.MaterialAlertDialog

Android API version: 29

Material Library version: com.google.android.material:material:1.2.0-alpha06

Device: Nokia 6.1 plus

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions