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

iOS Crash: NullReferenceException after VS 2019 update. #363

Closed
busec0 opened this issue Apr 16, 2019 · 4 comments
Closed

iOS Crash: NullReferenceException after VS 2019 update. #363

busec0 opened this issue Apr 16, 2019 · 4 comments

Comments

@busec0
Copy link

busec0 commented Apr 16, 2019

I'm encountering an issue on iOS after the update to VS 2019. I'm using XF 3.6.0 and Xamarin.iOS 12.8.0.0. It happens when an instance of TKCustomMap gets disposed.

Within the iOS's TKCustomMapRenderer the app crashes with NullReferenceException when base.Dispose(disposing) is called in the overridden method: protected override void Dispose(bool disposing)

It can easily be reproduced by pushing a page which contains a Map instance and then popping it from the Navigation.

You can download a sample app from here:

TKMaps_DisposeFailsSampleProject.zip

It opens two different pages:

  1. A Map Page using the default TKCustomMap implementation. Pushing and then popping the page will crash with NullReferenceException.
  2. Custom Maps Page. I've manually added the content from TKCustomMapRenderer in my iOS project (named it MapViewRenderer.cs) and commented out the call to base.Dispose() within the protected override void Dispose(bool disposing). App wont crash now.

The same issue is also opened here:
xamarin/xamarin-macios#5899

@pamela032709
Copy link

Have you found any workaround for this issue?

@busec0
Copy link
Author

busec0 commented Apr 18, 2019

Unfortunately no. In my debug builds I've manually added the iOS map view renderer and commented out the call to base.Dispose() (you can check my sample app, did the same thing there).

It will prevent it from crashing and let me work "normally", but it is not a reliable solution for production builds.

I'm still waiting for a fix and hope we'll get one soon, might be an issue with Xamarin.iOS as it worked just fine with the previous version.

@pamela032709
Copy link

pamela032709 commented Apr 18, 2019 via email

@busec0
Copy link
Author

busec0 commented Apr 23, 2019

Closing this as it was a Xamarin.iOS bug, the fix is ready and will soon be released.

Check for more info:
xamarin/xamarin-macios#5899

@busec0 busec0 closed this as completed Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants