Skip to content

[iOS] NRE after calling ViewCell.ForceUpdateSize #23092

@VitalyKnyazev

Description

@VitalyKnyazev

Description

A ListView with HasUnevenRows set to true causes NRE when view cell calls ForceUpdateSize to resize itself on iOS.
It seems to be caused by #22067 fix.

Steps to Reproduce

Launch sample project in iPhone simulator and click "Toggle description visibility" button.

Link to public reproduction project repository

https://github.com/VitalyKnyazev/MauiViewCellCrash

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI, Yes, this used to work in Xamarin.Forms

Last version that worked well

8.0.40 SR5

Affected platforms

iOS

Affected platform versions

iOS 17

Did you find any workaround?

No

Relevant log output

Object reference not set to an instance of an object.

   at Microsoft.Maui.Controls.Cell.OnForceUpdateSizeRequested()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:line 176
--- End of stack trace from previous location ---
   at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2594
   at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 60
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
   at MoneyTracker.Universal.Maui.Program.Main(String[] args) in E:\Projects\Git\Working\MoneyTrackerPro\MoneyTracker.Universal.Maui\Platforms\iOS\Program.cs:line 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-listviewListView and TableViewfixed-in-8.0.61fixed-in-9.0.0-preview.6.24327.7i/regressionThis issue described a confirmed regression on a currently supported versionmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertp/0Current heighest priority issues that we are targeting for a release.platform/iost/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions