-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support Android API 31 #7
Comments
@ozzy1873 thanks for the request ... will do! |
@ozzy1873 updated, available in v2.5.1 |
I think you also need to reference the latest MultiPlatformBleAdapter, which needs to reference the latest RxAndroidBle that has fixes for Android 12. |
Are you referring to https://github.com/dotintent/MultiPlatformBleAdapter? |
Yes, that is the project I am referring to. Unfortunately, it references RxAndroidBle 1.7.1. It needs to be updated to reference RxAndroidBle 1.13.1-rxjava2 or later, which has important fixes to support Android 12. There may be a branch that already does that, but I don't know for sure. I could try to help out, but my Android and iOS skills are pretty rough. |
Ah, ok, thanks. Sure thing, happy to help. |
Hi @ozzy1873, I spent some time trying to get things to work by forking In the meantime, based on a recommendation by a colleague, I reverted the API level to 30 in |
Thanks for trying! I will give 2.5.2 a go as soon as I am able. |
I finally had a chance to try 2.5.2. Unfortunately, it crashes on Android 12 with "cannot start Bluetooth". |
Thanks for reporting back. That's strange ... tried with a couple Android 12 and is fine on our side. Can you verify it's really this package that's crashing, or if it's some other config in your project? Thanks! |
I do not see what else could be causing the crash. Here is the exception: E/AndroidRuntime(26233): java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread. |
@ozzy1873 |
I am using Pixel 3 with Android 12 kernel 4.9.270 [√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.434], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] Connected device (3 available) • No issues found! |
I have now switched to using flutter_reactive_ble. It seems to work pretty well so far. |
@ozzy1873 Thanks for the update. Yes, we are planning to do the same. |
Hi @davejlin, any update on this? |
This is caused by a lack of permissions in Android 12 - bluetoothConnect. |
I did that but the error continues happening. |
I'm able to run this on Android on 12 and 13 now. The problem was not with this library. The permissions related to BLE changed in Android. This is the combination of permissions that worked for me:
In addition to those changes, I also have to request these permisstions at runtime: |
I've made a pull request which is aimed to solve the somewhat outdated MultiPlatformBleAdapter dependency and thus the permission issues. The pull request is merged in master and can be used in your Flutter applications by using the following in your
Please note that I have only validated the functioning of my app, which includes the following functionality:
Please test the updated dependency and let me know if any issues pop up! |
It would be great if you could support Android API 31.
The text was updated successfully, but these errors were encountered: