Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Flutter BLE scan fails on Android 12 and newer because of BLUETOOTH_SCAN

ErrorBLUETOOTH_SCAN permission denied

Short answer

Android 12 split Bluetooth into three permissions. A scan needs BLUETOOTH_SCAN declared in AndroidManifest.xml and also granted by the user at runtime, because it is a runtime permission. The old BLUETOOTH and location entries only apply to Android 11 and lower. Declare the new ones, request them in Dart, then scan again.

  • Applies to Flutter 3.35, Android 12 to 16, flutter_blue_plus
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the merged manifest of the built app and check which Bluetooth permissions actually ended up in it. A plugin or an old template line can differ from what you wrote.

    grep -n -i "bluetooth\|location" android/app/src/main/AndroidManifest.xml
  2. 2Match what you see, then jump to its fix

    1. 1The app targets Android 12 (API 31) or higher but only lists BLUETOOTH, BLUETOOTH_ADMIN and location permissionsBLUETOOTH_SCAN is not declared in the manifestFix
    2. 2The manifest is right, no Nearby devices dialog ever appears, and the scan is deniedThe permission is declared but never requested at runtimeFix
    3. 3Scanning is allowed but a specific beacon or sensor never shows upLocation is still required, or neverForLocation hides the deviceFix

What does the error look like?

  • BLUETOOTH_SCAN permission denied
  • Scan returns an empty list on Android 12 and newer

Cause 1 of 3

BLUETOOTH_SCAN is not declared in the manifest

1Check

Android's documentation says an app that targets API 31 or higher must declare BLUETOOTH_SCAN if it looks for Bluetooth devices. Look for that line in your manifest.

grep -n "BLUETOOTH_SCAN" android/app/src/main/AndroidManifest.xml

2Fix

Add the Android 12 permissions, and cap the legacy ones at API 30 so newer phones do not get them.

<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.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

3Verify

Rebuild so the manifest is merged again, then start a scan on an Android 12+ device.

flutter run -d <device-id>

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

The permission is declared but never requested at runtime

1Check

BLUETOOTH_SCAN, BLUETOOTH_CONNECT and BLUETOOTH_ADVERTISE are runtime permissions. The user must approve them in a dialog before you scan, connect or advertise. Search your Dart code for the request call.

grep -rn "Permission\.\|requestPermissions" lib/

2Fix

Ask for BLUETOOTH_SCAN and BLUETOOTH_CONNECT in Dart before the first scan, using the runtime-permission API of the plugin you already use. The exact permission names come from that plugin's documentation. Handle a denied answer in the UI.

# no shell command: add the runtime request in Dart, before calling startScan()

3Verify

Uninstall the app so the old decision is cleared, run it again and accept the Nearby devices dialog.

adb uninstall com.example.myapp && flutter run

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

Location is still required, or neverForLocation hides the device

1Check

If you set neverForLocation on BLUETOOTH_SCAN, Android's documentation warns that some BLE beacons are filtered out of the scan results. If your app derives location from scans, you need ACCESS_FINE_LOCATION instead.

grep -n "neverForLocation\|ACCESS_FINE_LOCATION" android/app/src/main/AndroidManifest.xml

2Fix

Keep neverForLocation only if you never use scan results for location. Otherwise remove it and declare ACCESS_FINE_LOCATION without a maxSdkVersion limit.

<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

3Verify

Rebuild, grant the permissions again and check that the missing device now appears.

flutter run -d <device-id>

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Declare permissions for the newest Android target and use maxSdkVersion for the legacy ones, as Android's Bluetooth guide shows.
  • Request Bluetooth permissions in one place, before the first scan, and handle a denied answer in the UI.
  • Test on one Android 11 or lower device and one Android 12 or higher device, because the two permission sets differ.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.