Missing BLUETOOTH_CONNECT permission but compile/target SDK are configured to 30

556 Views Asked by At

I'm implementing an Android library which supports some BLE utilities. In my build.gradle, both compile and target SDK are configured to 30, but I encountered missing permission error at compile time:

Error: Missing permissions required by BluetoothDevice.getName: android.permission.BLUETOOTH_CONNECT [MissingPermission]

My understanding is that BLUETOOTH_CONNECT is available after SDK 31. Any idea why I can see this error even if I've forced the SDK to 30?

0

There are 0 best solutions below