roubachof / Sharpnado.MaterialFrame

A modern MAUI (and XF) Frame component supporting blur, acrylic, dark mode. Implemented with RealtimeBlurView on Android (custom blurview) and UIVisualEffectView on iOS.
MIT License
505 stars 29 forks source link

Crash on Android 6.0 and newer #4

Closed jamesmontemagno closed 4 years ago

jamesmontemagno commented 4 years ago

Looks like : https://github.com/roubachof/Sharpnado.MaterialFrame/blob/5fa58c3834e8d2a6df6579ad00298bdb46f8a142/MaterialFrame/MaterialFrame.Android/AndroidMaterialFrameRenderer.cs#L119

https://developer.android.com/reference/android/graphics/drawable/GradientDrawable#getCornerRadius() was introduced in api 24

jamesmontemagno commented 4 years ago

A little stack trace for ya.

05-06 13:11:51.815 I/MonoDroid( 2866): Java.Lang.NoSuchMethodError: no non-static method "Landroid/graphics/drawable/GradientDrawable;.getCornerRadius()F" 05-06 13:11:51.815 I/MonoDroid( 2866): at Java.Interop.JniEnvironment+InstanceMethods.GetMethodID (Java.Interop.JniObjectReference type, System.String name, System.String signature) [0x0005b] in <26521a5118b44c858c385715922b9d5d>:0 05-06 13:11:51.815 I/MonoDroid( 2866): at Java.Interop.JniType.GetInstanceMethod (System.String name, System.String signature) [0x0000c] in <26521a5118b44c858c385715922b9d5d>:0 05-06 13:11:51.815 I/MonoDroid( 2866): at Java.Interop.JniPeerMembers+JniInstanceMethods.GetMethodInfo (System.String encodedMember) [0x00031] in <26521a5118b44c858c385715922b9d5d>:0 05-06 13:11:51.815 I/MonoDroid( 2866): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualSingleMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001c] in <26521a5118b44c858c385715922b9d5d>:0 05-06 13:11:51.815 I/MonoDroid( 2866): at Android.Graphics.Drawables.GradientDrawable.get_CornerRadius () [0x0000a] in <4ccdb3137d974856b786e1aeebbfbab6>:0 05-06 13:11:51.815 I/MonoDroid( 2866): at Sharpnado.Presentation.Forms.Droid.Renderers.AndroidMaterialFrameRenderer.SetAcrylicTheme () [0x00034] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\AndroidMaterialFrameRenderer.cs:170 05-06 13:11:51.815 I/MonoDroid( 2866): at Sharpnado.Presentation.Forms.Droid.Renderers.AndroidMaterialFrameRenderer.UpdateMaterialTheme () [0x0001f] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\AndroidMaterialFrameRenderer.cs:130 05-06 13:11:51.815 I/MonoDroid( 2866): at Sharpnado.Presentation.Forms.Droid.Renderers.AndroidMaterialFrameRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00037] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\AndroidMaterialFrameRenderer.cs:90 05-06 13:11:51.815 I/MonoDroid( 2866): at Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer.set_Element (Xamarin.Forms.Frame value) [0x00018] in D:\a\1\s\Xamarin.Forms.Platform.Android\FastRenderers\FrameRenderer.cs:66 05-06 13:11:51.815 I/MonoDroid( 2866): at Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00015] in D:\a\1\s\Xamarin.Forms.Platform.Android\FastRenderers\FrameRenderer.cs:87 05-06 13:11:51.815 I/MonoDroid( 2866): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350 05-06 13:11:51.815 I/MonoDroid( 2866): at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000b3] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140

roubachof commented 4 years ago

wow so setCornerRadius is available since api lvl 1 and getCornerRadius only since 24... Anyway, in version 1.6 getCornerRadius() is not called so I suggest to update to Sharpnado.Presentation.Forms v1.6, or if you are just using MaterialFrame, you can just grab the Sharpnado.MaterialFrame v1.0 package. And you will get blur background as well :)

jamesmontemagno commented 4 years ago

Hmmmmmmm i will give that a try :) I was using the older stuff, but have now moved to Sharpnado.materialFrame, i will verify!

jamesmontemagno commented 4 years ago

Can confirm all good!