stride icon indicating copy to clipboard operation
stride copied to clipboard

Android crashes when clicking into EditText UI control

Open Basewq opened this issue 8 months ago • 0 comments

Release Type: Official Release

Version: 4.2.0.2122

Platform(s): Android

Describe the bug Game crashes with NullReferenceException when you tap the EditText control

To Reproduce Steps to reproduce the behavior:

  1. Create an android project
  2. Add UI Page + add EditText control
  3. Run game, then tap into the EditText control

Expected behavior Not crash.

Additional context The EditText relies on a specific Layout, as per this line https://github.com/stride3d/stride/blob/d3dc84629d496156d2c579b30439d161d48ae5f1/sources/engine/Stride.Games/Starter/StrideActivity.cs#L53

However FindViewById returns null. The reason for this is because the Game.axml file isn't properly packaged into the nuget library for the developer to use.

Game.axml gets converted into a game.xml file (plain text), and is packed into Stride.Games nuget library inside a Stride.Games.aar file. In the 4.1.0.1948 nuget library, you can extract and view the game.xml to confirm the layout will exist, but in the 4.2.0.2122 nuget library it's just a corrupted zero byte file, so it'll never be found with FindViewById.

Basewq avatar May 27 '24 12:05 Basewq