Skip to content

fix: Upgrade react-native-ble-plx to v3.5.1 to fix disconnect crash#23

Merged
sammydamz merged 2 commits into
mainfrom
fix/ble-disconnect-crash-npe
Apr 19, 2026
Merged

fix: Upgrade react-native-ble-plx to v3.5.1 to fix disconnect crash#23
sammydamz merged 2 commits into
mainfrom
fix/ble-disconnect-crash-npe

Conversation

@sammydamz

Copy link
Copy Markdown
Owner

Summary

  • Upgrades react-native-ble-plx from 3.5.0 to 3.5.1 to fix a fatal crash on BLE disconnect
  • The crash was caused by all onError callbacks in the native Android module passing null as the error code to PromiseImpl.reject(), which requires a non-null code parameter

Root Cause

java.lang.NullPointerException: Parameter specified as non-null is null: method com.facebook.react.bridge.PromiseImpl.reject, parameter code

Every safePromise.reject(null, errorConverter.toJs(error)) in BlePlxModule.java (17 occurrences) triggered a fatal NPE when the BLE device disconnected, the transaction was cancelled, or any BLE error occurred.

Fix

v3.5.1 includes PR dotintent#1329 which replaces null with getErrorCode(error) — a proper error code string.

Related Issues

Note

This is a native module change — requires npx expo prebuild --clean and dev client rebuild after merging.

- Standalone sketch for testing EMG Click on Serial Monitor/Plotter
- 4 display modes: raw ADC, calibrated mV, centered, filtered
- Auto-calibrates baseline at startup
- Live stats every 2s (min, max, mean, RMS, peak-to-peak)
- Interactive commands via Serial: switch modes, recalibrate, pause
- Uses same ADC config and IIR filter as main firmware
@sammydamz sammydamz merged commit fdff35a into main Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant