flutter_blue
flutter_blue copied to clipboard
With Android 12 not find all bluetooth devices
I tried this fork in my app and with your example with my Pixel 4 running Android 12 and scan results are quite less rather than pauldemarco plugin. I found that the problem is on permissions: ble scan in Android 12 doesn't need permission for access_fine_location but if you don't allow this scanning lacks some devices. I had modified AndroidManifest.xml in:
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<!-- Request legacy Bluetooth permissions on older devices. -->
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
and giving manually location permission scan result is right. Ble devices that is not recognized are some old Sensoro Beacons, maybe they will be never supported in Android 12. Hope this helps.