flutter_bluetooth_basic icon indicating copy to clipboard operation
flutter_bluetooth_basic copied to clipboard

Does not scan bluetooth in android api 29 and 30

Open andresperezmelo opened this issue 5 years ago • 3 comments

The module is not able to scan bluetooth when compiling a project in targetSdkVersion 30 0 29 and compileSdkVersion 30 or 29

Works fine in api 28 or lower

Let's wait if the developer updates the package.

The problem

When compiled in api 29 or 30 the application is not able to request permanent location permission, only two options of

permission denied allow only with the app in use

And it turns out that the permission of only the app in use, your module is unable to scan bluetooth

Api 28 permission api 28 Api 28 app Api 28 buscar

Api 30 o 29 permission api 30

Doesn't scan in the app api 30 buscar

Let's hope they update it soon, if anyone knows of a similar package that works please let us know

Att: Andres Perez

andresperezmelo avatar Sep 25 '20 20:09 andresperezmelo

me too

mametjunior212 avatar Nov 24 '20 01:11 mametjunior212

and created this for Android https://pub.dev/packages/print_bluetooth_thermal

andresperezmelo avatar Nov 24 '20 02:11 andresperezmelo

I fix my project with android9. to android10 can not search bluetooth problem. All problems occur because android10 add new permission with bluetooth. Try to use this package permission_handler: ^5.0.1+1 https://pub.dev/packages/permission_handler

Before you call search bluetooth add these code Map<Permission, PermissionStatus> statuses = await [ Permission.location, Permission.locationWhenInUse, ].request(); print(statuses[Permission.location]); print(statuses[Permission.locationWhenInUse]);

Then call search ... It's work

Hope it can helps you

ossgoossgo avatar Dec 09 '20 10:12 ossgoossgo