kniEngine / kni

KNI is a cross-platform C# game framework.
Other
108 stars 6 forks source link

Android crash when sound is Up or Down from physical buttons #1635

Open gaetandezeiraud opened 3 weeks ago

gaetandezeiraud commented 3 weeks ago

The Android project template crash at startup if the volume up or down is pressed at startup (just after the splash screen) with a System.NullReferenceException: 'Object reference not set to an instance of an object.'.

One temporary workaround I found is to create a custom FrameLayout with a public override bool DispatchKeyEvent(KeyEvent e) and ignore when if (e.Action == KeyEventActions.Down || e.Action == KeyEventActions.Up). Not really a fix.

image

The problem is reproducible each time. On Android 9 and also 13 so I think all versions.

What version of KNI does the bug occur on:

What KNI platform are you using:

gaetandezeiraud commented 3 weeks ago

I saw this commit recently https://github.com/kniEngine/kni/commit/86aaa3cd4360c81636bc8e6026f68d2bc0e562fe. Does it mean no fix for this issue? Because it is maybe related to Xamarin?