在 Android Studio 中,在调试应用程序 BluetoothLeGatt 时,我遇到了以下异常:
从活页夹存根实现中捕获了一个 RuntimeException。java.lang.SecurityException:需要 ACCESS_COARSE_LOCATION 或 ACCESS_FINE_LOCATION 权限才能在 android.bluetooth 的 android.os.Parcel.readException(Parcel.java:1637) 的 android.os.Parcel.readException(Parcel.java:1684) 处获取扫描结果。 IBluetoothGatt$Stub$Proxy.startScan(IBluetoothGatt.java:678) 在 android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:367) 在 android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56)在 android.os.Binder.execTransact(Binder.java:565)