You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: Android (All), All
Comments on the original bug report:
On 2021-01-08 01:40:29 +0000, Jordan Christiansen wrote:
Created attachment 4642
Patch to disable BluetoothManager for old versions of Android
On Android, prior to API version 18 (i.e. Android 4.1 and older) the BluetoothManager API did not exist yet. However, SDL always uses BluetoothManager when Bluetooth is enabled, causing a crash at runtime with the following stack trace:
E/AndroidRuntime: FATAL EXCEPTION: SDLActivity
java.lang.NoClassDefFoundError: android.bluetooth.BluetoothManager
at org.libsdl.app.HIDDeviceManager.initializeBluetooth(HIDDeviceManager.java:377)
at org.libsdl.app.HIDDeviceManager.(HIDDeviceManager.java:153)
at org.libsdl.app.HIDDeviceManager.acquire(HIDDeviceManager.java:36)
at org.libsdl.app.SDLActivity.startNative(SDLActivity.java:260)
at org.libsdl.app.SDLActivity.onCreate(SDLActivity.java:240)
at org.love2d.android.GameActivity.onCreate(GameActivity.java:117)
at android.app.Activity.performCreate(Activity.java:5063)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
SDL should not try to use the BluetoothManager API if the OS is at an API version less than 18.
I attached a patch that simply disables Bluetooth if BluetoothManager is not present. Ideally Bluetooth should still be supported, but I'm not sure if there are any non-BLE devices that we would need to support in a game.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: Android (All), All
Comments on the original bug report:
On 2021-01-08 01:40:29 +0000, Jordan Christiansen wrote:
On 2021-01-08 02:23:02 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: