stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.47k stars 934 forks source link

Android Application Crash at startup #1597

Open tagcode opened 1 year ago

tagcode commented 1 year ago

Release Type: Official Release Version: 4.1.0.1734 Platform(s): Android Describe the bug Non-deterministic System.ArgumentNullException and crash at application start.

To Reproduce Steps to reproduce the behavior:

  1. Install GameMenu or FirstPersonShooter sample application with Android support

Expected behavior Application to run

Screenshots

GameMenu

Log and callstacks [Stride] [Game]: Error: Unexpected exception. System.ArgumentNullException: Array cannot be null. (Parameter 'bytes') [Stride] at System.Text.Encoding.GetString(Byte* bytes, Int32 byteCount) [Stride] at Silk.NET.Core.Native.SilkMarshal.Utf8PtrToString(IntPtr ptr) [Stride] at Silk.NET.Core.Native.SilkMarshal.PtrToString(IntPtr input, NativeStringEncoding encoding) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader, UInt32 bufSize, UInt32& length, String& infoLog) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader, String& info) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader) [Stride] at Stride.Graphics.GraphicsDevice.TryCompileShader(ShaderType shaderType, String sourceCode) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 578 [Stride] at Stride.Graphics.GraphicsDevice.CreateCopyProgram(Boolean srgb, Int32& offsetLocation, Int32& scaleLocation) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 319 [Stride] at Stride.Graphics.GraphicsDevice.GetCopyProgram(Boolean srgb, Int32& offsetLocation, Int32& scaleLocation) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 234 [Stride] at Stride.Graphics.CommandList.CopyScaler2D(Texture sourceTexture, Texture destTexture, Rectangle sourceRectangle, Rectangle destRectangle, Boolean flipY) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\CommandList.OpenGL.cs:line 515 [Stride] at Stride.Graphics.SwapChainGraphicsPresenter.EndDraw(CommandList commandList, Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\SwapChainGraphicsPresenter.OpenGL.cs:line 58 [Stride] at Stride.Games.GameBase.EndDraw(Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 816 [Stride] at Stride.Engine.Game.EndDraw(Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\Game.cs:line 445 [Stride] at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 670 [Stride] at Stride.Games.GameBase.RawTickProducer() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 586System.ArgumentNullException: Array cannot be null. (Parameter 'bytes') [Stride] at System.Text.Encoding.GetString(Byte* bytes, Int32 byteCount) [Stride] at Silk.NET.Core.Native.SilkMarshal.Utf8PtrToString(IntPtr ptr) [Stride] at Silk.NET.Core.Native.SilkMarshal.PtrToString(IntPtr input, NativeStringEncoding encoding) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader, UInt32 bufSize, UInt32& length, String& infoLog) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader, String& info) [Stride] at Silk.NET.OpenGLES.GL.GetShaderInfoLog(UInt32 shader) [Stride] at Stride.Graphics.GraphicsDevice.TryCompileShader(ShaderType shaderType, String sourceCode) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 578 [Stride] at Stride.Graphics.GraphicsDevice.CreateCopyProgram(Boolean srgb, Int32& offsetLocation, Int32& scaleLocation) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 319 [Stride] at Stride.Graphics.GraphicsDevice.GetCopyProgram(Boolean srgb, Int32& offsetLocation, Int32& scaleLocation) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\GraphicsDevice.OpenGL.cs:line 234 [Stride] at Stride.Graphics.CommandList.CopyScaler2D(Texture sourceTexture, Texture destTexture, Rectangle sourceRectangle, Rectangle destRectangle, Boolean flipY) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\CommandList.OpenGL.cs:line 515 [Stride] at Stride.Graphics.SwapChainGraphicsPresenter.EndDraw(CommandList commandList, Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Graphics\OpenGL\SwapChainGraphicsPresenter.OpenGL.cs:line 58 [Stride] at Stride.Games.GameBase.EndDraw(Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 816 [Stride] at Stride.Engine.Game.EndDraw(Boolean present) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\Game.cs:line 445 [Stride] at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 670 [Stride] at Stride.Games.GameBase.RawTickProducer() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Games\GameBase.cs:line 586 **System.ArgumentNullException:** 'Array cannot be null. (Parameter 'bytes')'

Additional context Sometimes runs, sometimes not.

tagcode commented 1 year ago

Issue is known on Silk.NET 2.10.1 and fixed. Stride.Graphics.csproj should be updated to use newer version.