50ButtonsEach/flic2-documentation

Permission Issu on API-Level 33

harrypotter06 opened this issue · 4 comments

Hello,

with Android 12 (API 31), we had no issues with the Library. Scan for new buttons work fine.
On Android 13 (API 33) we got a error, if scan new Flic2Button:

System.Exception: Need android.permission.BLUETOOTH_CONNECT

This Error is in GattService registerClient.

The App was build für Android 12 (API 31)

In AppManifest i set this permissions:

<uses-permission android:name="android.permission.BLUETOOTH"  />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"  />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"  />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"  />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.INTERNET"/>

I thik is any changes on API 33?
Whats the solution to Fix it?

Emill commented

I assume you mean this library? https://github.com/50ButtonsEach/flic2lib-android

In that case, please post the issue there instead of here.

Anyway, what I know, the Bluetooth permission mechanism has not been changed in Android 13. Have you followed the instructions in the readme text of the library? The BLUETOOTH_CONNECT permission is a runtime permission so it's not enough to simply declare it in the manifest.

You can also check out https://github.com/50ButtonsEach/flic2lib-android-sample.

So it works with Android 12 and lower, but not with Android 13
So I don't think the error is in the code

What did you meen with "permission is a runtime permission"?

I've been using the library for years. Problem only appears with Android 13.

Sorry - I checked - Runtime Permission are set and on Device you can see in App Permission, that all Permissions are allowed

Emill commented

Can you show the full stack trace of the exception when running the sample at https://github.com/50ButtonsEach/flic2lib-android-sample?