b3b / able

Python for Android Bluetooth Low Energy package
MIT License
38 stars 18 forks source link

CRASH at buildozer permission #37

Closed sooko closed 1 year ago

sooko commented 1 year ago

App crashed on android 12 api 31 when declare android permision BLUETTOH and BLUETOOTH_ADMIN.

b3b commented 1 year ago

Thank you for reporting this issue, @sooko Fixed in able 1.0.12 . To build with the new version, additional permissions should be added to buildozer.spec:

android.permissions =
    BLUETOOTH,
    BLUETOOTH_ADMIN,
    BLUETOOTH_SCAN,
    BLUETOOTH_CONNECT,
    BLUETOOTH_ADVERTISE,
    ACCESS_FINE_LOCATION

Since Android 12, new runtime permissions are required:

Crash was caused by attempt to to turn on the adapter without obtaining BLUETOOTH_CONNECT permission first.

In new able version, permissions are requested before before trying to access the adapter.