Closed ogak-github closed 4 months ago
I have exactly the same issue on a Galaxy A55 running Android version 14.
The same code works perfectly on a Galaxy A21s running Android 12.
Flutter version 3.22.3.
seems like OS problem
@ogak-github it's probably OS-related. Check your AndroidManifest.xml if you granted all permssions needed (location for example).
@spehj these are permission I used on AndroidManifest.xml.
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
<!-- required for API 18 - 30 -->
<uses-permission
android:name="android.permission.BLUETOOTH"/>
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- API 31+ -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@ogak-github it looks ok to me. Some Android versions require to have location turned on while using BLE for scanning. Which Android version do you have? I don't know HiOS so I can only give you some general advice.
Requirements
Have you checked this problem on the example app?
Yes
FlutterBluePlus Version
1.32.11
Flutter Version
3.22.2
What OS?
Android
OS Version
HiOS 14.0.0
Bluetooth Module
Bluetooth
What is your problem?
Empty scan results
Logs