Skip to content

v3.5.2

Choose a tag to compare

@sfourdrinier sfourdrinier released this 26 Sep 19:42
· 162 commits to master since this release

πŸ› Bug Fixes

Android: Fix RN 0.81 NPE by providing non-null error code to Promise.reject

This release fixes a critical crash on Android when using React Native 0.81+.

Problem

React Native 0.81's PromiseImpl.reject() now requires a non-null error code parameter. Previously, many code paths in the library called promise.reject(null, ...) which causes a NullPointerException in the native bridge.

Solution

  • Added DEFAULT_ERROR_CODE = "BlePlxError" constant
  • Replaced all reject(null, ...) calls with reject(DEFAULT_ERROR_CODE, ...)
  • Preserved all existing error payloads - only the error code is now non-null

Impact

  • Prevents NPE crashes in RN 0.81+ when BLE errors occur
  • Unblocks ECG monitoring and other BLE features on Android/Android TV
  • No breaking changes - error handling behavior remains the same

πŸ“¦ Installation

npm install @sfourdrinier/react-native-ble-plx@3.5.2

πŸ”— References