Bug 42066 - CarouselView crashes with System.MethodAccessException on Android
Summary: CarouselView crashes with System.MethodAccessException on Android
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-06-22 07:07 UTC by matti_koopa
Modified: 2017-06-15 16:37 UTC (History)
2 users (show)

Tags: crash
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description matti_koopa 2016-06-22 07:07:46 UTC
This happens with any CarouselView I add to a page. Just crashes on render.
Works fine on UWP.

System.MethodAccessException: Method `Xamarin.Forms.BindingBase:TryGetSynchronizedCollection (System.Collections.IEnumerable,Xamarin.Forms.CollectionSynchronizationContext&)' is inaccessible from method `Xamarin.Forms.ItemsView/ItemsSourceProxy:get_SyncContext ()'


Stack:

 0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal  C#
    0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/data/lanes/2923/52635947/source/mono/mcs/class/corlib/System.Diagnostics/Debugger.cs:122,4 C#
    0x27 in object.32512b7a-3f19-4ad3-ae2d-5a553dc939a0 C#
    0x15 in Xamarin.Forms.ItemsView.ItemsSourceProxy.get_Item   C#
    0x7 in Xamarin.Forms.ItemsView.Xamarin.Forms.IItemViewController.GetItem    C#
    0x7 in Xamarin.Forms.Platform.ItemViewAdapter.GetItemViewType   C#
    0xB in Android.Support.V7.Widget.RecyclerView.Adapter.n_GetItemViewType_I   C#
    0x17 in object.32512b7a-3f19-4ad3-ae2d-5a553dc939a0 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_object_method_a   C#
>   0x6C in Java.Interop.JniEnvironment.InstanceMethods.CallObjectMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11279,28  C#
    0xF in Android.Runtime.JNIEnv.CallObjectMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:102,4   C#
    0x50 in Android.Support.V7.Widget.RecyclerView.Recycler.GetViewForPosition  C#
    0x1AE in Xamarin.Forms.Platform.PhysicalLayoutManager.OnLayoutChildren  C#
    0x1C in Android.Support.V7.Widget.RecyclerView.LayoutManager.n_OnLayoutChildren_Landroid_support_v7_widget_RecyclerView_Recycler_Landroid_support_v7_widget_RecyclerView_State_ C#
    0x1D in object.8c8fbc3a-c392-45e9-baca-9ca976faf4c8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x22 in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:41,36    C#
    0x66 in Android.Views.ViewGroup.Layout at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3188,5    C#
    0x63 in Xamarin.Forms.Platform.Android.ViewRenderer<Xamarin.Forms.CarouselView,Android.Support.V7.Widget.RecyclerView>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\ViewRenderer.cs:123,4 C#
    0x1F in Xamarin.Forms.Platform.CarouselViewRenderer.OnLayout    C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x2F in object.4107a513-6b08-4d38-90b8-03ada46af7a8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.CarouselView>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5  C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x2F in object.4107a513-6b08-4d38-90b8-03ada46af7a8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5  C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x2F in object.4107a513-6b08-4d38-90b8-03ada46af7a8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5  C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x2F in object.4107a513-6b08-4d38-90b8-03ada46af7a8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5   C#
    0x3F in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:310,5    C#
    0x8 in Xamarin.Forms.Platform.Android.NavigationRenderer.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:103,4   C#
    0x10 in Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240,4    C#
    0x2F in object.4107a513-6b08-4d38-90b8-03ada46af7a8 C#
    0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a  C#
    0x8F in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079,18  C#
    0x16 in Android.Runtime.JNIEnv.CallNonvirtualVoidMethod at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:444,4  C#
    0xF7 in Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:223,6    C#
    0xC6 in Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:89,5 C#
    0xE in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.UpdateLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137,5 C#
    0xA7 in Xamarin.Forms.Platform.Android.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:1007,5    C#
    0x20 in Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:73,4 C#
    0x12 in Android.Views.ViewGroup.n_OnLayout_ZIIII at /Users/builder/data/lanes/3340/4e275588/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3427,4  C#
    0x2F in object.bbf768b4-5241-4907-a3c6-fff42ebce252 C#
Comment 1 Paul DiPietro [MSFT] 2017-03-10 18:48:05 UTC
Wondering if this is related to 44533 at all. Any specific reproductions are appreciated as well since I've recently run another project on Android using pre2 and everything seemed okay.
Comment 2 Paul DiPietro [MSFT] 2017-06-15 16:37:25 UTC
We will be moving to the CarouselView in PR #853 on GitHub in the future, so this is being closed.