缺少 BLUETOOTH_CONNECT 权限,但编译/目标 SDK 配置为 30

Jin*_* Wu 5 android android-permissions android-ble

我正在实现一个支持一些 BLE 实用程序的 Android 库。在我的build.gradle中,编译和目标SDK都配置为30,但我在编译时遇到了缺少权限错误:

错误:缺少 BluetoothDevice.getName 所需的权限:android.permission.BLUETOOTH_CONNECT [MissingPermission]

我的理解是,BLUETOOTH_CONNECT 在 SDK 31 之后可用。知道为什么即使我将 SDK 强制设置为 30,我也会看到此错误吗?