twilio / audioswitch

An Android audio management library for real-time communication apps.
Apache License 2.0
159 stars 49 forks source link

java.lang.SecurityException: Need BLUETOOTH permission #106

Closed james04gr closed 2 years ago

james04gr commented 2 years ago

Describe the bug In my android application i have used the audioSwitch dependency. While i have tested my app on Android 10 && Android 11 devices when i run the application in an Android 12 device i get a SecurityException like below

java.lang.SecurityException: Need BLUETOOTH permission when i try to run the audioSwitch.start

After a little research that i have made, i saw that Android 12 has some restrictions in the Bluetooth functionality. Specifically, The BLUETOOTH_ADVERTISE, BLUETOOTH_CONNECT, and BLUETOOTH_SCAN permissions are runtime permissions.

So i guess you need to update your code as soon as Android 12 comes to a Release mode

4brunu commented 2 years ago

Did you tried the last version 1.1.3?

james04gr commented 2 years ago

Well, i updated the dependency as you suggested and everything works fine. Thank you

4brunu commented 2 years ago

Could you please close this issue? 🙂