Skip to content

Windows 10 Crash (0xc000027b) on connect/upgrade (Incompatibility with C++/WinRT 2.0) #185

@mecoj

Description

@mecoj

Summary

Fatal crash occurs only on Windows 10 when calling UniBLE.connect() on a paired BLE device. The identical code works perfectly on Windows 11.

This issue does not happen on app start. It occurs when a specific action (like a firmware upgrade) is triggered while already connected to a device.

What Works: Scanning and basic connections work correctly, even on Windows 10.

What Fails: Calling a specific function (e.g., firmware upgrade logic) while connected causes a 100% crash on Windows 10.

Crash Details

Faulting application name: MYAPP.exe
Faulting module name: universal_ble_plugin.dll
Exception code: 0xc000027b (STATUS_INVALID_IMAGE_HASH)
Fault offset: 0x0000000000028394

Description

The app crashes with error code 0xc000027b (STATUS_INVALID_IMAGE_HASH) when attempting to connect to a paired Bluetooth LE device on Windows 10. The same code works perfectly on Windows 11.

Environment

  • OS: Windows 10 (Build 19045 and lower)
  • Plugin Version: universal_ble: ^0.21.1
  • Works on: Windows 11 (Build 22000+)
  • Fails on: Windows 10 (all builds)
  • Unpackaged Win32 EXE (built with flutter build windows)

Steps to Reproduce

  1. Pair a BLE device in Windows Settings (Device shows as "Paired: true")
  2. Run Flutter app with universal_ble
  3. Scan for devices successfully
  4. Attempt to connect to paired device:
   await UniBle.connect(deviceId);
  1. App crashes immediately with 0xc000027b

Logs

...

[SUCCESS] BLE scan initiated
[SUCCESS] Device discovered: LS_LOADER_OTA (00:0B:29:00:03:01)
[INFO] Device paired: true
[INFO] Attempting connection...
11:02:57: UniBLE.connect() - bleDevice: 00:0B:29:00:03:01, connected: false
11:02:57: ConnectionLog: Device found

[FATAL] App terminated - no exception caught

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions