Xamarin-macios: [d16-0] UIKit.UIGestureRecognizer.Dispose crash after loading a map page for the second time

Created on 15 Apr 2019  Β·  18Comments  Β·  Source: xamarin/xamarin-macios

Steps to Reproduce

  1. click on a tkcustommaps page from TK.CustomMaps
  2. navigate away from the page and come back to it will crash
  3. use a master-detail page click on the menu

Expected Behavior

no crash

Actual Behavior

crashes the second time it load the page with the map

Environment

visual studio 2019
mac OS -mojave
XCODE-10.2
Iphone 12.2

1.
Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]
Visual Studio for Mac: Visual Studio > About Visual Studio > Show Details > Copy Information [button]

  1. Paste into the code block below (between ```)
    -->
=== Visual Studio Enterprise 2019 for Mac ===

Version 8.0.2 (build 23)
Installation UUID: 7692fd6e-5645-498f-b996-0c7a5632bf5c
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.6.0.2 (d16-0 / 040682909)

    Package version: 518010003

=== Mono Framework MDK ===

Runtime:
    Mono 5.18.1.3 (2018-08/fdb26b0a445) (64-bit)
    Package version: 518010003

=== NuGet ===

Version: 4.8.2.5835

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    2.1.9
    2.1.8
    2.1.2
    2.0.5
    2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
SDK Versions:
    2.1.505
    2.1.504
    2.1.302
    2.1.4
    2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.9
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.2 (14490.120)
Build 10E125

=== Xamarin.Mac ===

Version: 5.8.0.0 (Visual Studio Enterprise)
Hash: 0aa84521
Branch: d16-0
Build date: 2019-04-02 16:01:19-0400

=== Xamarin.iOS ===

Version: 12.8.0.0 (Visual Studio Enterprise)
Hash: 0aa84521
Branch: d16-0
Build date: 2019-04-02 16:01:19-0400

=== Xamarin Designer ===

Version: 4.17.4.418
Hash: 3d086e814
Branch: remotes/origin/d16-0
Build date: 2019-04-01 09:20:10 UTC

=== Xamarin.Android ===

Version: 9.2.0.5 (Visual Studio Enterprise)
Android SDK: /Users/compriop/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        5.0 (API level 21)
        6.0 (API level 23)
        7.0 (API level 24)
        7.1 (API level 25)
        8.0 (API level 26)
        8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.0
SDK Build Tools Version: 27.0.3

Build Information: 
Mono: mono/mono/2018-08-rc@5ad371dab1b
Java.Interop: xamarin/java.interop/d16-0@c987483
LibZipSharp: grendello/LibZipSharp/master@44de300
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
MXE: xamarin/mxe/xamarin@b9cbb535
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.26.0@325e91a
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-0@0a7edd6

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/compriop/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 1.2.0.14
Hash: 86df26f
Branch: remotes/origin/d16-0
Build date: 2019-04-05 16:58:56 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 800020023
Git revision: c576bb008dfe54cdcf596237e09564ebd2da4343
Build date: 2019-04-06 10:06:46+00
Build branch: master
Xamarin extensions: 2c996830618e7cb8e8be97984d643eb86f122e8d

=== Operating System ===

Mac OS X 10.14.4
Darwin 18.5.0 Darwin Kernel Version 18.5.0
    Mon Mar 11 20:40:32 PDT 2019
    root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64


Build Logs

Example Project (If Possible)

VS bug #853566

bug iOS regression vs-sync

Most helpful comment

Reopneing until fixed in d16-0 (or we decide not to push there).

All 18 comments

Thanks for the report!

I believe this is a duplicate of https://github.com/xamarin/xamarin-macios/issues/5388 though 12.8.0.0 should have the fix, as it is d16-0.

Can you please provide more information on tkcustommaps page from TK.CustomMaps. Is this from a Xamarin sample?

Could you provide a sample that shows the issue?

I'm encountering this issue as well with https://github.com/TorbenK/TK.CustomMap within the TKCustomMapRenderer https://github.com/TorbenK/TK.CustomMap/blob/Development/Source/TK.CustomMap.iOSUnified/TKCustomMapRenderer.cs.

In the overridden Dispose method, the call to base.Dispose() crashes the application.

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.

this are the settings when this use to work

=== Visual Studio Community 2017 for Mac ===

Version 7.6.11 (build 9)
Installation UUID: 54f5440e-7f67-45f3-aa9f-cab795782549
Runtime:
Mono 5.12.0.309 (2018-02/39d89a335c8) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

Package version: 512000309

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.2
2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.302/Sdks
SDK Versions:
2.1.302
2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.3
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 10.1 (14460.46)
Build 10B61

=== Xamarin.Mac ===

Version: 5.0.0.0 (Visual Studio Community)
Hash: b40230c0
Branch:
Build date: 2018-09-27 11:41:37-0400

=== Xamarin.iOS ===

Version: 12.2.1.10 (Visual Studio Community)
Hash: f2a05edd
Branch: d15-9
Build date: 2018-10-31 18:55:57-0400

=== Xamarin.Android ===

Version: 9.0.0.20 (Visual Studio Community)
Android SDK: /Users/compsoml/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.2
SDK Build Tools Version: 26.0.3

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 706110009
Git revision: d7cd66f5e3acd3d46ba0b94a0c935378f828bde0
Build date: 2018-10-31 17:17:12+00
Build branch: release-7.6
Xamarin extensions: bc9b985bfcb480b04a208a6d4045adc443a07857

=== Operating System ===

Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
Thu Jun 21 22:53:14 PDT 2018
root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

to clone the sample go to
https://github.com/pamela032709/custommapscrash

Please refer to my original post to the current settings in which this crash happen

I can now reproduce this:

Tested with 12.8.0.0

Reopneing until fixed in d16-0 (or we decide not to push there).

Has anyone got a quick fix in hand to work around this until the fix is shipped? We're pretty impeded by this.

Has anyone got a quick fix in hand to work around this until the fix is shipped? We're pretty impeded by this.

100% need a workaround as well. This is crippling my work!

me too , I had to stop my release because of this.

Sent from my iPhone

On Apr 29, 2019, at 9:37 PM, darkgod90 notifications@github.com wrote:

Has anyone got a quick fix in hand to work around this until the fix is shipped? We're pretty impeded by this.

100% need a workaround as well. This is crippling my work!

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@pamela032709 I'm going back to VS2017 - will let you know if this fixes the issue.

@darkgod90 I'm not sure that will make a difference, I'm using jetbrains Rider and I'm still seeing this problem.

Going back to VS2017 and the version of Xamarin.iOS that comes with it fixes it! Highly recommend you uninstall VS2019 and go back to VS2017.

I did that but nothing change thats why is so strange not sure if is VS issue or it is some compatibility issue with XCode or the nugget itself

Sent from my iPhone

On Apr 29, 2019, at 9:49 PM, Chase Florell notifications@github.com wrote:

@darkgod90 I'm not sure that will make a difference, I'm using jetbrains Rider and I'm still seeing this problem.

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I have the latest Xcode AND VS2019 on my mac.
The only thing I did was downgrade to VS2017 on my PC. When I connected it to my mac, it noticed that Xamarin.iOS has a different version, and automatically asked to downgrade. I said yes, waited 5 minutes and et voila'

it's Xamarin iOS that's the problem, not the IDE per sΓ©.
Xamarin/'MS need to ship a patch, or perhaps we can switch to Alpha or Nightly on our IDE?

I agree, I was just explaining a workaround that worked for me hoping it would help others.

On Apr 29, 2019, at 23:29, Chase Florell notifications@github.com wrote:

it's Xamarin iOS that's the problem, not the IDE per sΓ©.
Xamarin/'MS need to ship a patch, or perhaps we can switch to Alpha or Nightly on our IDE?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

If you're using Visual Studio (for Mac) 2019, you can download what will most likely be the version we ship for the next service release by going here, clicking on the green checkmark for the top commit, then downloading the xamarin.ios-12.8.0.2.pkg package and installing it manually on the Mac.

I can confirm that downloading that version of Xamarin.iOS on my Mac has solved the issue. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

parmjitv picture parmjitv  Β·  4Comments

sharmashiv picture sharmashiv  Β·  4Comments

whitneyschmidt picture whitneyschmidt  Β·  3Comments

mandel-macaque picture mandel-macaque  Β·  3Comments

therealjohn picture therealjohn  Β·  3Comments