-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Don't dispose the _labelTextColorDefault on Label Fast Renderer #7163
Conversation
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue6994.cs
Outdated
Show resolved
Hide resolved
The old-style renderer shouldn't be disposing of this value, either, but we're getting away with it because of the container.
|
@samhouts I tested your reproduction, thanks for doing that, I confirm that removing the dispose labelTextColorDefault fix the issue. So I made some more testing after that, and found that removing the Trigger make the crash disappear. From the stacktrace it's cause by :
If I remove it no more crash, and if I navigate back the dispose is called, so I don't know if it a right thing or not. Is the label rendered need to be destroyed and recreated if you do that ? stackLayout.Children.Remove(instructions);
stackLayout.Children.Insert(0, instructions); Actually it's the case. It will need some more in depth testing. |
Failing tests don't look related. Also can't repro locally. |
Yea the Android failure is one I see randomly with Android tests :-/ It seems like the UI test runner just crashes for some reason. I have an issue logged here for it microsoft/appcenter#893 Similarly with the CollectionView on iOS for some reason it fails to navigate to the test and it just gets stuck on the screen listing the tests |
Description of Change
#6467 disposes the
_labelTextColorDefault
on the fast LabelRenderer for Android. This causes a NullPointerException when attempting to access it later.This does not happen on the legacy renderer, which now also has the same dispose but a slightly different pattern of setting the value. Using the same pattern does not fix the crash on the Fast Renderer, so the best thing is to remove the dispose and possibly revisit this later.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
Before/After Screenshots
Not applicable
Testing Procedure
There is an automated test with instructions.
PR Checklist