If the targetsdkversion of your project is 31, i.e. Android 12 and above, according to the new Bluetooth feature added by Android, you need to configure the following permissions to use it properly.
The crash may be due to incorrect configuration of permissions:
<!-- Needed only if your app looks for Bluetooth devices.
You must add an attribute to this permission, or declare the
ACCESS_FINE_LOCATION permission, depending on the results when you
check location usage in your app. -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<!-- Needed only if your app makes the device discoverable to Bluetooth
devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<!-- Needed only if your app communicates with already-paired Bluetooth
devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Detailed article:https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
Comments
0 comments
Please sign in to leave a comment.