edufolly / flutter_bluetooth_serial

A basic Flutter Bluetooth Serial
MIT License
478 stars 460 forks source link

Need android.permission.BLUETOOTH_CONNECT #168

Open kotran88 opened 2 years ago

kotran88 commented 2 years ago

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

rickcasson commented 2 years ago

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