dotnet / Silk.NET

The high-speed OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, WebGPU, and DirectX bindings library your mother warned you about.
https://dotnet.github.io/Silk.NET
MIT License
3.88k stars 378 forks source link

Android 14/API 34 RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED error #2232

Closed Basewq closed 1 week ago

Basewq commented 1 week ago

Summary

Running on an Android device with Android 14+ will throw an error on the Activity.OnCreate method Java.Lang.SecurityException: ' One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts'

As per Google, IntentFilters must explicitly declare RECEIVER_EXPORTED/RECEIVER_NOT_EXPORTED flag or the OS will just crash the app: https://developer.android.com/develop/background-work/background-tasks/broadcasts#context-registered-receivers

Comments

Requires updated SDL code, eg. Current code has https://github.com/dotnet/Silk.NET/blob/9b12fbeb69f2b29c9b48b36033f0953d6db17c8c/src/Windowing/SilkDroid/app/src/main/java/org/libsdl/app/HIDDeviceManager.java#L196 But new SDL properly declares https://github.com/libsdl-org/SDL/blob/3d42412650119a8e13a016e289e5860c034dde19/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java#L196-L200

No workaround for Android 14+ due to it baked in the OS.

Perksey commented 1 week ago

Duplicate of #2210, we will be updating our binaries shortly.

Basewq commented 1 week ago

Duplicate of #2210, we will be updating our binaries shortly.

Just double checking as I don't know your build system, you'll also be updating the SDL code as well? As far as I can tell, you don't have these latest changes (in fact, the last update for this fix on SDL side of things was just last week)

Perksey commented 1 week ago

Yes.