AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.06k stars 2.26k forks source link

Render exception on Android #17034

Open sessiontalk opened 2 months ago

sessiontalk commented 2 months ago

Describe the bug

When restarting an Android app after swipinig it from the task switcher, views are not displayed and get blank screen with the folloiwng stack trace

[Visual]Exception in render loop: 'System.NullReferenceException: Object reference not set to an instance of an object. at Avalonia.Android.Platform.SkiaPlatform.TopLevelImpl.Avalonia.OpenGL.Egl.EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.get_Handle() at Avalonia.OpenGL.Egl.EglGlPlatformSurface.CreateGlRenderTarget(IGlContext context) at Avalonia.Skia.GlRenderTarget..ctor(GRContext grContext, IGlContext glContext, IGlPlatformSurface glSurface) at Avalonia.Skia.GlSkiaGpu.TryCreateRenderTarget(IEnumerable1 surfaces) at Avalonia.Skia.SkiaContext.CreateRenderTarget(IEnumerable1 surfaces) at Avalonia.Rendering.PlatformRenderInterfaceContextManager.CreateRenderTarget(IEnumerable1 surfaces) at Avalonia.Rendering.Composition.Server.ServerCompositor.CreateRenderTarget(IEnumerable1 surfaces) at Avalonia.Rendering.Composition.Server.ServerCompositionTarget.Render() at Avalonia.Rendering.Composition.Server.ServerCompositor.RenderCore(Boolean catchExceptions) at Avalonia.Rendering.Composition.Server.ServerCompositor.RenderReentrancySafe(Boolean catchExceptions) at Avalonia.Rendering.Composition.Server.ServerCompositor.Render(Boolean catchExceptions) at Avalonia.Rendering.Composition.Server.ServerCompositor.Render() at Avalonia.Rendering.RenderLoop.TimerTick(TimeSpan time)'

To Reproduce

NA

Expected behavior

NA

Avalonia version

11.1.3

OS

Android

Additional context

No response

emmauss commented 2 months ago

Please, check if this issue occurs on the latest nightly. There have been changes since 11.1.3 that addressed this issue.