osu-framework
osu-framework copied to clipboard
Game won't launch in Android Emulator: `DllNotFoundException: libveldrid-spirv`
I use Visual Studio v17.7.4 as my IDE. And created a solution with the command dotnet new osu-framework-game
.
Then, due to the lack of an Android project, I created it by myself, and basically its startup method looked like this:
[Activity(ConfigurationChanges = DEFAULT_CONFIG_CHANGES, Exported = true, LaunchMode = DEFAULT_LAUNCH_MODE, MainLauncher = true)]
public class ZeroVActivity : AndroidGameActivity {
protected override osu.Framework.Game CreateGame() => new ZeroVGame();
}
For other configuration files, they are basically consistent with the osu!lazer project.
But confusingly, in the emulator, it doesn't work properly. Immediately after every startup, it crashes and exits. Whereas on my own Android device it works fine. Looking through the runtime.log
, I get the following error:
2023-10-13 13:52:10 [error]: System.DllNotFoundException: libveldrid-spirv
In addition, through searching, I learned that such a issue exists. I want to know if these two problems are the same? And, as a user of this package, how can I solve or mitigate this problem.
As a supplement, I tried
- Compiling and executing other projects, such as osu!lazer;
- Building the project with Debug and Release;
- Different versions of Android (13.0-API 33, 12.0-API 31);
- Changing
hw.gpu.mode
in the emulator settings to various possible values.
But no luck.
The linked comment is not related.
It's likely an issue with our veldrid-spirv
fork. Not sure if that came from upstream, but I have suspicions about this:
https://github.com/ppy/veldrid-spirv/blob/ca6cec7843ea790ceea9864b9879f866d0d90f32/.github/workflows/build.yml#L134
I'm not sure android-x86_64
is a valid RID. It probably needs to be android-x64
. This would only affect emulator because the emulator is pretty much the only usage of x64 binaries anywhere. 99.9% of actual devices are arm. Either that or it's some other build issue.
In general I don't recommend developing against the emulator. It's a substandard developer experience in several ways, and as evident, a poor reflection of actual hardware.
In general I don't recommend developing against the emulator. It's a substandard developer experience in several ways, and as evident, a poor reflection of actual hardware.
Yes, I think so. But my need for this is more about a quick preview of function availability and effects. I am an iOS device user, so for me, Android devices are not readily available. Support for the simulator will greatly help me make the preview function more convenient.