You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Mapsui in my net6-android project and it's been working fine. I recently upgraded to net7-android. Everything works fine after this update as long as I deploy as Debug. but when I build and deploy a Release version the Mapsui constructor crashes with System.NotSupportedException: Cannot create instance of type 'SkiaSharp.Views.Android.SKGLSurfaceView': no Java peer type found.
Crash occures on:
varmapControl=newMapControl(Context,null);
Steps to Reproduce
Create new 'Android Application' in VS 17.4.4
Add reference to Mapsui library
construct masui MapControl:
varmapControl=newMapControl(Context,null);
Build and deploy to emulator as Debug - it works
Build and deploy to emulator as Release - it crashes
Did you find any workaround?
no, tried adding SkiaSharp reference but didn't help.
Relevant log output
Error: Unhandled Exception
System.Exception: CurrentDomainOnUnhandledException
---> System.NotSupportedException: Cannot create instance of type'SkiaSharp.Views.Android.SKGLSurfaceView': no Java peer type found.
at Java.Interop.JniPeerMembers.JniInstanceMethods..ctor(Type )
at Java.Interop.JniPeerMembers.JniInstanceMethods.GetConstructorsForType(Type )
at Java.Interop.JniPeerMembers.JniInstanceMethods.StartCreateInstance(String , Type , JniArgumentValue* )
at Android.Opengl.GLSurfaceView..ctor(Context )
at SkiaSharp.Views.Android.SKGLSurfaceView..ctor(Context context)
at Mapsui.UI.Android.MapControl.StartHardwareRenderMode()
at Mapsui.UI.Android.MapControl.Initialize()
at Mapsui.UI.Android.MapControl..ctor(Context context, IAttributeSet attrs)
at GTApp.Android.MapMeasure.OnConfigureDataView()
at GTApp.Android.MeasureView`1[[Mapsui.UI.Android.MapControl, Mapsui.UI.Android, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]].BuildDataView() at GTApp.Android.MeasureView`1[[Mapsui.UI.Android.MapControl, Mapsui.UI.Android, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]]..ctor(Context context, MeasureDef measureDef, Activity activity, LayoutViewMode mode)
at GTApp.Android.MapMeasure..ctor(Context context, MeasureDef measureDef, Activity activity, LayoutViewMode mode)
at GTApp.Android.MeasureView.GetViewFor(Context context, MeasureDef measureDef, Activity activity, LayoutViewMode mode)
at GTApp.Android.MeasureView.<>c__DisplayClass100_0.<GetViewsForListOrdered>b__2(Measure m)
at System.Linq.Enumerable.SelectListIterator`2[[GTCore.Measure, GTCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GTApp.Android.MeasureView, GTApp.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at System.Collections.Generic.List`1[[GTApp.Android.MeasureView, GTApp.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].InsertRange(Int32 , IEnumerable`1 ) at System.Collections.Generic.List`1[[GTApp.Android.MeasureView, GTApp.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].AddRange(IEnumerable`1 ) at GTApp.Android.MeasureView.GetViewsForListOrdered(Context context, Activity gtActivity) at GTApp.Android.MeasureListDialog.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr , IntPtr , IntPtr , IntPtr , IntPtr ) at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr ) Exception_EndOfInnerExceptionStack
The text was updated successfully, but these errors were encountered:
Android application type
Android for .NET (net7.0-android)
Affected platform version
.Net 7.0.102
Description
I'm using Mapsui in my net6-android project and it's been working fine. I recently upgraded to net7-android. Everything works fine after this update as long as I deploy as Debug. but when I build and deploy a Release version the Mapsui constructor crashes with
System.NotSupportedException: Cannot create instance of type 'SkiaSharp.Views.Android.SKGLSurfaceView': no Java peer type found.
Crash occures on:
Steps to Reproduce
Create new 'Android Application' in VS 17.4.4
Add reference to Mapsui library
construct masui MapControl:
Build and deploy to emulator as Debug - it works
Build and deploy to emulator as Release - it crashes
Did you find any workaround?
no, tried adding SkiaSharp reference but didn't help.
Relevant log output
The text was updated successfully, but these errors were encountered: