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
When using GradientStopCollection together with Background setter, in certain scenarios Android throws mentioned exception.
I was not able to trim down code for sharing, because it's called after a series of callbacks and skipping some of them makes issue go away.
Exception:
System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.PancakeView.Droid.PancakeDrawable from native handle 0xbfb0fafc (key_handle 0x2f236dc9).
---> System.MissingMethodException: No constructor found for Xamarin.Forms.PancakeView.Droid.PancakeDrawable::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
Unable to activate instance of type Xamarin.Forms.PancakeView.Droid.PancakeDrawable from native handle 0xbfb0fb1c (key_handle 0xf639376).
at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x0017e] in <123>:0
at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x00023] in <123>:0
at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <123>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <123>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in <123>:0
at Android.Graphics.Drawables.Drawable.n_GetOpacity (System.IntPtr jnienv, System.IntPtr native__this) [0x00000] in <123>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.74(intptr,intptr)
(Visual Studio stops at base.OnElementPropertyChanged(sender, e); line in Droid.PancakeViewRenderer.OnElementPropertyChanged.)
Commenting out Background or BackgroundGradientStops setter resolves the issue.
Occurs on Xamarin.Forms 5.0.0.1874.
Maybe related: #113. Adding constructor public PancakeDrawable(IntPtr handle, global::Android.Runtime.JniHandleOwnership transfer) { } and null-check for _pancake in Dispose method seems to resolve the issue.
The text was updated successfully, but these errors were encountered:
When using
GradientStopCollection
together withBackground
setter, in certain scenarios Android throws mentioned exception.I was not able to trim down code for sharing, because it's called after a series of callbacks and skipping some of them makes issue go away.
Exception:
(Visual Studio stops at
base.OnElementPropertyChanged(sender, e);
line in Droid.PancakeViewRenderer.OnElementPropertyChanged.)Style that causes exception:
Commenting out
Background
orBackgroundGradientStops
setter resolves the issue.Occurs on Xamarin.Forms 5.0.0.1874.
Maybe related: #113. Adding constructor
public PancakeDrawable(IntPtr handle, global::Android.Runtime.JniHandleOwnership transfer) { }
and null-check for_pancake
inDispose
method seems to resolve the issue.The text was updated successfully, but these errors were encountered: