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
flutter_blue_plus\FlutterBluePlusPlugin.java uses or overrides a deprecated API #46
Comments
It looks like this project is using Android's BluetoothAdapter startLeScan and stopLeScan methods, which are deprecated; here are the warnings with the deprecated linting enabled:
This SO answer says to use BluetoothLeScanner instead, which is available since API level 21 (Android 5.0). |
Oh ok, currently my minSDK level is 19, so bumping that to 24 would exclude some of my users. Although I know that it could get rid of some spurious Bluetooth behavior if I'd support higher min SDK level. I wish support libraries would port back the newer scanner to 19. Although that's ancient, KitKat. Usually iOS users who really want my app dig up some dusty slow crappy old tablet from a bottom of a drawer and those sometimes are KitKat. PITA. |
It's a question though when will the currently used API deprecate. Having a plan to transition to BluetoothLeScanner. I accidentally wrote API level 24, I meant 21 and that's not so far from 19. |
Here is a way to use both: https://stackoverflow.com/a/39412791/292502
|
Actually we are checking before call:
Thing is that we cannot write all that logic to single line and extracting to methods startScan21 and startScan18 makes this false-positive warning. |
Oooh! That's great to know! Sorry for not checking the source code! |
When I run
flutter build apk
, I get the following warning:Version Info:
flutter_blue_plus:
1.1.3
Flutter:
The text was updated successfully, but these errors were encountered: