question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android 12 Support

See original GitHub issue
  • [ x] I am running the latest version
  • [ x] I checked the documentation and found no answer
  • [ x] I checked to make sure that this issue has not already been filed
  • [ x] I’m sure that question is related to the library itself and not Bluetooth Low Energy or Classic in general. If that so, please post your question on StackOverflow or on our Gitter channel.

Question

Hey guys I’m wondering that if you have in plan to add support for Android 12 any time soon, cause I started to test how my app is working on Android 12 and I have some problems. When I’m disconnecting from the device I’m getting this error:

{
message: "Device ......... was disconnected"
errorCode: 201
attErrorCode: 0
iosErrorCode: null
androidErrorCode: null
reason: "Disconnected from ........... with status 0 (GATT_SUCCESS)"
name: "BleError"
}

which is good but attErrorCode is always 0 no matter what I do, I tried to go out of range, reset the device but the attErrorCode is not changing. I tested on a physical device Pixel 5 with Android 12 Beta 5. I couldn’t replicate this problem on any other device with any other version of android. I’m asking this question because I saw that Google made some changes around the Bluetooth permissions and I’m wondering if this might affect this library somehow. Currently, I’m running on: “react-native”: “0.63.3” “react-native-ble-plx”: “^2.0.2” So, can you please tell me if the Android 12 can impact you guys somehow and if you have anything planned to support Android 12?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:26

github_iconTop GitHub Comments

5reactions
fabiendemcommented, Aug 15, 2022

@mciechanowicz @bor-ski, sorry to tag you here, but we would need some help with this, or some clarity on the maintenance of the repo.

Currently, react-native-ble-plx uses a version of https://github.com/dotintent/MultiPlatformBleAdapter which is not wrapping the latest RxAndroidBle library. Instead it wraps an old version of RxAndroidBle which does runtime checks on the permissions, requiring the Location permissions on Android 12 (with targetSdkVersion 31+) while it’s not needed, even if the new Bluetooth Permissions are granted. The latest version of RxAndroidBle doesn’t have this issue.

It looks like the update should go in two steps:

Could you please clarify the status of the react-native-ble-plx project since .intent took ownership? Should we look at alternative libraries? Forking and fixing it ourselves could be a solution, but if the project is no longer maintained by a community, and if the fixes never land on the main branch, it may not be a viable long term solution.

Thanks

3reactions
ericschaalcommented, Oct 13, 2022

Hi @fabiendem and others

That’s exactly what we did here react-native-ble-plx We updated MultiPlatformBleAdapter to use the latest RxAndroidBle

We also pushed it to NPM

Not sure if it’s bulletproof, we didn’t go as far as using it in production yet but preliminary testing shows that it works well on Android 12.

It’s really sad that this library is no longer maintained.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android 12
Android 12 is our most personal OS ever, featuring dynamic color capabilities that can transform your experience based on your wallpaper and responsive...
Read more >
Android 12 - Wikipedia
Android 12 was released publicly on October 4, 2021, through Android Open Source Project (AOSP) and was released to supported Google Pixel devices...
Read more >
Android 12 features, supported devices and what to know
Android 12 compatibility · Pixel 6 and Pixel 6 Pro · Pixel 3 to Pixel 5 (including XL and A-series phones) · Oppo...
Read more >
Android 12 features: Everything you need to know
The color changes take place all over the OS, including the Settings, Quick Settings tiles, and any app with Material You support. On...
Read more >
Android 12L explained: What is it, and which devices support it?
Android 12L is designed for tablets and foldables like the Samsung Galaxy Z Fold 4 and tablets like the Galaxy Tab S8, while...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found