-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I add java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT but it doesn't work #187
Comments
You need to uninstall the app completely from your device and reinstall it. Make sure, that you have granted all the permissions. This worked at my case (with the same error). |
E/MethodChannel#flutter_bluetooth_serial/methods(15942): Failed to handle method call |
Same issue, also not working on the release mode |
Have you explicitly requested the permission from within the app? From that Android developer website link:
To do this, use the permission_handler plugin. |
Problem summary
Apparently the problem is due to the new version of Android 12, which needs bluetooth access permissions.
I am testing on a moto g50 with android 12, I tried on a moto g70 with android 11 and everything works fine.
in android docs find this https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#declare-android12-or-higher
Steps to reproduce
E/MethodChannel#flutter_bluetooth_serial/methods( 4896): java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for android.content.AttributionSource@8702d63b: getName
I add java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT but it doesn't work
Environment
flutter --version
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (1 year, 6 months ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4
The text was updated successfully, but these errors were encountered: