-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Failed to inflate ColorStateList - error fix for CheckBox #24658
Conversation
@@ -65,6 +65,8 @@ | |||
<!-- remove all the min sizes as MAUI manages it --> | |||
<item name="android:minWidth">0dp</item> | |||
<item name="android:minHeight">0dp</item> | |||
<!-- remove the button tint as MAUI manages it --> | |||
<item name="buttonTint">?attr/colorPrimary</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can also be set to @null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think colorPrimary
is defined in the templates only? What will happen if you were to remove it?
Maybe @null
or anything else may be better? Of does this color always exist in a plain android app with no styles or colors?
I see it at the top of the file...
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe (briefly) in the PR description, how you found the solution?
Related code in the stacktrace is:
- https://github.com/androidx/androidx/blob/eb9bb69458e843b95602ba7f32210c0808293c1f/appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java#L81
- https://github.com/androidx/androidx/blob/eb9bb69458e843b95602ba7f32210c0808293c1f/appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCompoundButtonHelper.java#L80
Hi, |
Looking at timestamps, it looks to me that 8.0.90-ci.net8.24459.1 was compiled before this fix was merged. |
Ah okay. I will try again tomorrow. |
Description
In the styles.xml file, I noticed that
Widget.Material3.CompoundButton.CheckBox
is set as the parent forMauiCheckBox
. However, Maui.MainTheme hasTheme.MaterialComponents.DayNight
as its parent.After changing the parent of
Maui.MainTheme
toTheme.Material3.DayNight.NoActionBar
, the error disappeared, but I had some reservations about whether that was the right solution.So I dug deeper and found in
src/Core/AndroidNative/maui/build/intermediates/incremental/release/mergeReleaseResources/merger.xml
the following codeIssues Fixed
Fixes #18897
Fixes #24602