Hi!
Here is my example application: https://drive.google.com/open?id=1HtD5CNjyibRtnQ6dVikYpvuluGgeLEyF
I have a MasterDetailPage as default MainPage.
There is a RadListView in the MenuPage, and a Button in the DetailPage.
When the Button is clicked, it will set MainPage to a new ContentPage( e.g. Application.Current.MainPage = new NewMainPage(); ), then an unhandled exception occcured.
How to fix this problem?
Unhandled Exception:
05-28 03:40:38.649 D/Mono ( 1267): Loading reference 6 of Mono.Android.dll asmctx DEFAULT, looking for System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
05-28 03:40:38.649 D/Mono ( 1267): Image addref System.Runtime.Serialization[0x8456d220] (asmctx DEFAULT) -> System.Runtime.Serialization.dll[0x83ca4e00]: 2
05-28 03:40:38.650 D/Mono ( 1267): Prepared to set up assembly 'System.Runtime.Serialization' (System.Runtime.Serialization.dll)
05-28 03:40:38.650 D/Mono ( 1267): Assembly System.Runtime.Serialization[0x8456d220] added to domain RootDomain, ref_count=1
05-28 03:40:38.650 D/Mono ( 1267): AOT: image 'System.Runtime.Serialization.dll.so' not found: dlopen failed: library "System.Runtime.Serialization.dll.so" not found
05-28 03:40:38.650 D/Mono ( 1267): AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/sdks/out/android-x86-release/lib/mono/aot-cache/x86/System.Runtime.Serialization.dll.so' not found: dlopen failed: library "/Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/sdks/out/android-x86-release/lib/mono/aot-cache/x86/System.Runtime.Serialization.dll.so" not found
05-28 03:40:38.650 D/Mono ( 1267): Config attempting to parse: 'System.Runtime.Serialization.dll.config'.
05-28 03:40:38.650 D/Mono ( 1267): Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/sdks/out/android-x86-release/etc/mono/assemblies/System.Runtime.Serialization/System.Runtime.Serialization.config'.
05-28 03:40:38.650 D/Mono ( 1267): Assembly Ref addref Mono.Android[0x9cd41220] -> System.Runtime.Serialization[0x8456d220]: 2
05-28 03:40:38.650 D/Mono ( 1267): Loading reference 0 of System.Runtime.Serialization.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
05-28 03:40:38.650 D/Mono ( 1267): Assembly Ref addref System.Runtime.Serialization[0x8456d220] -> mscorlib[0x9cd3f4e0]: 73
Loaded assembly: System.Runtime.Serialization.dll [External]
Unhandled Exception:
System.NotSupportedException: Unable to activate instance of type Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer from native handle 0x69 (key_handle 0xb8b115d).
05-28 03:40:40.602 D/Mono ( 1267): DllImport attempting to load: '/system/lib/liblog.so'.
05-28 03:40:40.603 D/Mono ( 1267): DllImport loaded library '/system/lib/liblog.so'.
05-28 03:40:40.603 D/Mono ( 1267): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
05-28 03:40:40.603 D/Mono ( 1267): Searching for '__android_log_print'.
05-28 03:40:40.603 D/Mono ( 1267): Probing '__android_log_print'.
05-28 03:40:40.603 D/Mono ( 1267): Found as '__android_log_print'.
05-28 03:40:40.605 I/MonoDroid( 1267): UNHANDLED EXCEPTION:
05-28 03:40:40.606 I/MonoDroid( 1267): System.NotSupportedException: Unable to activate instance of type Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer from native handle 0x69 (key_handle 0xb8b115d). ---> System.MissingMethodException: No constructor found for Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
05-28 03:40:40.606 I/MonoDroid( 1267): --- End of inner exception stack trace ---
05-28 03:40:40.606 I/MonoDroid( 1267): at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00055] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.606 I/MonoDroid( 1267): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00116] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.606 I/MonoDroid( 1267): --- End of inner exception stack trace ---
05-28 03:40:40.606 I/MonoDroid( 1267): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00182] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.606 I/MonoDroid( 1267): at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000c1] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.606 I/MonoDroid( 1267): at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Android.Views.View.get_Parent () [0x0001f] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].UpdateParentPageTraversalOrder () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:399
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00116] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:369
05-28 03:40:40.607 I/MonoDroid( 1267): at (wrapper delegate-invoke) <
Module
>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:211
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Element.set_Parent (Xamarin.Forms.Element value) [0x00094] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:210
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:335
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.ViewCell.set_View (Xamarin.Forms.View value) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\Cells\ViewCell.cs:25
05-28 03:40:40.607 I/MonoDroid( 1267): at Telerik.XamarinForms.DataControlsRenderer.Android.FormsListViewDataSourceAdapterBase.ClearCachedViews () [0x0003d] in <
54bca44b8fc84b77a4760736d165085c
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Telerik.XamarinForms.DataControlsRenderer.Android.RadListViewDataSourceAdapter.ClearCachedViews () [0x00000] in <
54bca44b8fc84b77a4760736d165085c
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Telerik.XamarinForms.DataControlsRenderer.Android.RadListViewDataSourceAdapter.Dispose (System.Boolean disposing) [0x00003] in <
54bca44b8fc84b77a4760736d165085c
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Telerik.XamarinForms.DataControlsRenderer.Android.ListViewRenderer.OnElementDetached (Telerik.XamarinForms.DataControls.RadListView oldElement) [0x0003c] in <
54bca44b8fc84b77a4760736d165085c
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Telerik.XamarinForms.Common.Android.AndroidRendererBase`2[S,T].Dispose (System.Boolean disposing) [0x0002d] in <
4164515d6fbe493ba6368ab0a3de92cc
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x000a4] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:312
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.Dispose (System.Boolean disposing) [0x0000a] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1280
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x000a4] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:312
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.PageRenderer.Dispose (System.Boolean disposing) [0x00011] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\PageRenderer.cs:44
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.MasterDetailContainer.DisposeChildRenderers () [0x0000b] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:114
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00009] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:91
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00076] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:152
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00095] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:233
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Object.Dispose () [0x00000] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.AppCompat.Platform.Cleanup (System.Collections.Generic.List`1[T] viewsToRemove, System.Collections.Generic.List`1[T] renderersToDispose) [0x00036] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:338
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPageInternal (Xamarin.Forms.Page newRoot) [0x000b9] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:322
05-28 03:40:40.607 I/MonoDroid( 1267): at Xamarin.Forms.Platform.Android.AppCompat.Platform+<>c__DisplayClass36_0.<
SetPage
>b__0 () [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:269
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:40.607 I/MonoDroid( 1267): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.80(intptr,intptr)
05-28 03:40:40.611 W/zygote ( 1267): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
05-28 03:40:40.613 D/Mono ( 1267): DllImport searching in: '__Internal' ('(null)').
05-28 03:40:40.613 D/Mono ( 1267): Searching for 'java_interop_jnienv_throw'.
05-28 03:40:40.613 D/Mono ( 1267): Probing 'java_interop_jnienv_throw'.
05-28 03:40:40.613 D/Mono ( 1267): Found as 'java_interop_jnienv_throw'.
Unhandled Exception:
System.NotSupportedException: Unable to activate instance of type Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer from native handle 0x69 (key_handle 0xb8b115d).
05-28 03:40:41.142 E/mono ( 1267):
05-28 03:40:41.142 E/mono ( 1267): Unhandled Exception:
05-28 03:40:41.142 E/mono ( 1267): System.NotSupportedException: Unable to activate instance of type Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer from native handle 0x69 (key_handle 0xb8b115d). ---> System.MissingMethodException: No constructor found for Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
05-28 03:40:41.142 E/mono ( 1267): --- End of inner exception stack trace ---
05-28 03:40:41.142 E/mono ( 1267): at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00055] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:41.142 E/mono ( 1267): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00116] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:41.142 E/mono ( 1267): --- End of inner exception stack trace ---
05-28 03:40:41.142 E/mono ( 1267): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.80(intptr,intptr)
05-28 03:40:41.142 E/mono ( 1267): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.80(intptr,intptr)
05-28 03:40:41.142 E/mono-rt ( 1267): [ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Unable to activate instance of type Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer from native handle 0x69 (key_handle 0xb8b115d). ---> System.MissingMethodException: No constructor found for Telerik.XamarinForms.DataControlsRenderer.Android.ListView.TemplateCellContainer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
05-28 03:40:41.142 E/mono-rt ( 1267): --- End of inner exception stack trace ---
05-28 03:40:41.142 E/mono-rt ( 1267): at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00055] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:41.142 E/mono-rt ( 1267): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00116] in <
a6696dd5fce04f5480364911ef1529f2
>:0
05-28 03:40:41.142 E/mono-rt ( 1267): --- End of inner exception stack trace ---
05-28 03:40:41.142 E/mono-rt ( 1267): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.80(intptr,intptr)
05-28 03:40:41.142 E/mono-rt ( 1267): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.80(intptr,intptr)
05-28 03:40:41.143 D/ ( 1267): HostConnection::get() New Host Connection established 0x8407c540, tid 1267