Hello everyone,
I am experiencing a critical issue with the Bluetooth Low Energy (BLE) component in Thunkable that is causing my app to crash immediately upon sending commands. Everything was working perfectly a few days ago, but now the app has become completely unstable without any changes to the logic.
The Problem: When I call the Transmit Byte Array block, the application crashes and displays a “Critical Error Occurred” screen. Looking at the detailed Android logs, I see two recurring scenarios:
-
GATT Status 10 (GATT_NOT_FOUND): The log shows
BleGattCharacteristicException: GATT exception from MAC='XX:XX:XX...', status 10 (GATT_NOT_FOUND), type BleGattOperation{description='CHARACTERISTIC_WRITE'}. -
GATT Status 133: Occasionally, I get a status 133 error before the crash.
-
Internal Crash: Both scenarios lead to a
java.lang.NullPointerExceptionatcom.facebook.react.bridge.PromiseImpl.reject. It seems the BLE library fails to handle the GATT error and passes a null parameter, which crashes the React Native bridge.
Technical Details:
-
Hardware: STM32 microcontroller with an HM-10 (CC2541) Bluetooth module.
-
Firmware: The C code handles UART commands (ASCII ‘C’, ‘6’, ‘X’) and is confirmed working via a PC terminal.
-
Thunkable Blocks: I am using
Connect to Device, waiting for discovery, and then callingTransmit Byte Arrayusing the standard UUID0000ffe1-0000-1000-8000-00805f9b34fb. -
Issue: Even if the device status is “Connected”, the moment I try to write a characteristic, the app terminates.
What I’ve Tried:
-
Verified the Characteristic UUID matches the hardware (FFE1).
-
Added delays (up to 5 seconds) between connection and transmission to allow for Service Discovery.
-
Cleared Bluetooth cache and restarted the Android device.
-
Tried removing the “Subscribe” block to minimize GATT operations.
Since the hardware logic (RNG, timers, and UART state machine) is fully functional on the microcontroller side, this appears to be a bug in the Thunkable BLE implementation or the underlying com.polidea.rxandroidble2 library.
Has anyone encountered this PromiseImpl.reject NullPointerException recently? Is there a workaround to prevent the app from crashing when a GATT error occurs?
Thank you for your help!