[BUG] Release mode crash
Description
Upon updating my applicatino from 3.118 preview 2.3 to 3.119, I observed a release mode crash on Android. I opened an issue upstream at the behest of an .NET Android developer, but the issue itself may exist in the library.
Original issue: https://github.com/dotnet/android/issues/10096
Code
Not code related, crashes on initializing a SKGLView
Expected Behavior
No crash in release mode
Actual Behavior
Actually crashes in release mode
Version of SkiaSharp
Other (Please indicate in the description)
Last Known Good Version of SkiaSharp
3.118.0-preview.2 (Next Preview)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
- Android 16
- Windows 11 26100.3915
Devices
- Google Pixel 6a
Relevant Screenshots
No response
Relevant Log Output
[AndroidRuntime] android.runtime.JavaProxyThrowable: [System.NotSupportedException]: Cannot create instance of type 'SkiaSharp.Views.Android.SKGLTextureView+InternalRenderer': no Java peer type found.
[AndroidRuntime] at Java.Interop.JniPeerMembers+JniInstanceMethods..ctor + 0x4b(Unknown Source)
[AndroidRuntime] at Java.Interop.JniPeerMembers+JniInstanceMethods.GetConstructorsForType + 0x41(Unknown Source)
[AndroidRuntime] at Java.Interop.JniPeerMembers+JniInstanceMethods.StartCreateInstance + 0x25(Unknown Source)
[AndroidRuntime] at Java.Lang.Object..ctor + 0x2f(Unknown Source)
[AndroidRuntime] at SkiaSharp.Views.Android.SKGLTextureViewRenderer..ctor + 0x0(Unknown Source)
...
and
[MonoDroid] --- End of managed Java.Lang.UnsupportedOperationException stack trace ---
[MonoDroid] java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
I did confirm that downgrading to 3.118 preview 2.3 resolves the issue with the same MAUI version. This is definitely a regression in the library
3.119 also seems to result in a release mode crash on MacCatalyst as well. May be different root causes.
3.119also seems to result in a release mode crash onMacCatalystas well. May be different root causes.
Yes, I'm getting MacCatalyst release mode crash.... works in debug, release crashes as shown below... Application Specific Backtrace 0: 0 CoreFoundation 0x000000018fefeca0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018f9c2b90 objc_exception_throw + 88 2 RC600 Editor 0x000000010092a828 xamarin_unhandled_exception_handler + 0 3 RC600 Editor 0x0000000100b84f0c -[SKCanvasView drawRect:] + 152
3.119also seems to result in a release mode crash onMacCatalystas well. May be different root causes.Yes, I'm getting MacCatalyst release mode crash.... works in debug, release crashes as shown below... Application Specific Backtrace 0: 0 CoreFoundation 0x000000018fefeca0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018f9c2b90 objc_exception_throw + 88 2 RC600 Editor 0x000000010092a828 xamarin_unhandled_exception_handler + 0 3 RC600 Editor 0x0000000100b84f0c -[SKCanvasView drawRect:] + 152
... although downgrading to 3.118 preview 2.3 does NOT resolve this crash.
Also facing this issue, when reverting to 3.118-preview2.3 it does not occur