Skip to content
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

Maui.Controls.Handlers.Compatibility.NavigationRenderer.ParentingViewController: Object reference not set to an instance of an object #25726

Open
PramodMAUI opened this issue Nov 7, 2024 · 12 comments
Labels
area-navigation NavigationPage i/regression This issue described a confirmed regression on a currently supported version s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@PramodMAUI
Copy link

Description

Getting below exception in iOS app only:

{System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Maui.Controls.Handlers.Compatibility.NavigationRenderer.ParentingViewController.WillMoveToParentViewController(UIViewController parent) 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 61 at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 96 at xxxxx.Mobile.Program.Main(String[] args

When I manipulate the navigation stack while loading another page, the application crashes. For example, suppose I have Page1 and Page2 in the navigation stack, and I navigate to Page3 from Page2. While initializing the Page3 object, I remove Page2 from the navigation stack. After Page3 finishes loading, the application crashes.

I tried removal of page from navigation stack on Mainthread.

Steps to Reproduce

When I manipulate the navigation stack while loading another page, the application crashes. For example, suppose I have Page1 and Page2 in the navigation stack, and I navigate to Page3 from Page2. While initializing the Page3 object, I remove Page2 from the navigation stack. After Page3 finishes loading, the application crashes.

Link to public reproduction project repository

No response

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

iOS

Affected platform versions

iOS 16, iOS 17, iOS 18

Did you find any workaround?

No response

Relevant log output

No response

@PramodMAUI PramodMAUI added the t/bug Something isn't working label Nov 7, 2024
@Zhanglirong-Winnie
Copy link

Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

@Zhanglirong-Winnie Zhanglirong-Winnie added the s/triaged Issue has been reviewed label Nov 8, 2024
@jfversluis jfversluis added the s/needs-repro Attach a solution or code which reproduces the issue label Nov 8, 2024
@eshalisa
Copy link

eshalisa commented Nov 8, 2024

I also recently had issues with this. I don't know how to reproduce but here are the two call stacks from Sentry:
Image
Image

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Nov 8, 2024
@PramodMAUI
Copy link
Author

PramodMAUI commented Nov 11, 2024

@Zhanglirong-Winnie @jfversluis While navigating to Third page app crashes. Please find sample project here:
https://github.com/PramodMAUI/iOSCrashWhenManipulatingStack/tree/main

@PramodMAUI
Copy link
Author

Hi @Zhanglirong-Winnie Any update on this? Are you able to reproduce this issue?

@jbeacham
Copy link

We are having this same issue in our app. Would love to see an answer/solution. Will be migrating from Xamarin to MAUI for an app hosting millions of users in the next couple months.

@hgarcianareia
Copy link

Same error here. This is blocking our xamarin to MAUI migration launch

@mattleibow
Copy link
Member

@PureWeen does this sound familiar?

@mattleibow mattleibow added area-navigation NavigationPage and removed s/needs-attention Issue has more information and needs another look labels Nov 12, 2024
@mattleibow mattleibow added this to the Backlog milestone Nov 12, 2024
@sondrebh
Copy link

We are seeing a lot of this in our MAUI app as well.

@MichaelAtSway
Copy link

Same issue here - I've tried moving the RemovePage call to different places in the app but the error still pops up and crashes the app...

@jbeacham
Copy link

@Zhanglirong-Winnie Any update? We are a very large Xamarin app migrating to MAUI (#2 Free Medical app on the App Store on Top Charts this August). This is a big issue to be outstanding for the Microsoft team to be forcing users to migrate.

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage i/regression This issue described a confirmed regression on a currently supported version labels Nov 19, 2024
@Zhanglirong-Winnie
Copy link

This issue has been verified using Visual Studio 17.13 Preview 1(8.0.93 & 8.0.83 & 8.0.60 & 8.0.40). Can repro this issue on iOS platform. And 8.0.40 works fine.

@PramodMAUI
Copy link
Author

PramodMAUI commented Nov 19, 2024

Sorry it's bit confusing. Do you mean in 8.0.40, the issue is not reproducible? @Zhanglirong-Winnie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-navigation NavigationPage i/regression This issue described a confirmed regression on a currently supported version s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants