flutter_bluetooth_serial icon indicating copy to clipboard operation
flutter_bluetooth_serial copied to clipboard

Need android.permission.BLUETOOTH_CONNECT

Open kotran88 opened this issue 2 years ago • 1 comments

Problem summary

Steps to reproduce

  1. First step, example: "Open example app"
  2. Second step, example: "Turn on Bluetooth"

I followed above step but cause error

java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10498, packageName = io.github.edufolly.flutterbluetoothserialexample, attributionTag = null, token = android.os.BinderProxy@41f62ba, next = null }: getName

and I added

    <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

to androidmanifest.xml but it keep same and ask me nothing about permission

Environment

flutter version is 2.10.5

kotran88 avatar May 11 '22 07:05 kotran88

This is related to permission requirement changes in Android 12. Try one of the 3 open PRs that address this issue: #159, #162, or #163

rickcasson avatar May 16 '22 23:05 rickcasson