-
Notifications
You must be signed in to change notification settings - Fork 355
Description
Describe the bug
PluginController.swift:106: Assertion failed
This started happening immediately upon upgrading to Xcode 13.
To Reproduce
Steps to reproduce the behavior:
- Connect to one device using
connectToAdvertisingDevice()
- Subscribe to a qualified characteristic
- Observe a failure with exception (including the part of the stack trace, belonging to this package)
reactive_ble_mobile/PluginController.swift:106: Assertion failed
reactive_ble_mobile/PluginController.swift:106: Assertion failed
* thread #1, queue = 'com.apple.main-thread', stop reason = Assertion failed
frame #0: 0x000000018f287060 libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
-> 0x18f287060 <+0>: ret
libswiftCore.dylib`_swift_reportToDebugger:
0x18f287064 <+0>: b 0x18f287060 ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
0x18f287068 <+0>: adrp x8, 321903
0x18f28706c <+4>: ldrb w0, [x8, #0xfd1]
Target 0: (Runner) stopped.
Lost connection to device.
Expected behavior
No error, as was the case with Xcode prior to 13 (and as is the case with Android).
Smartphone / tablet
- Any iOS device
Peripheral device
- Nordic nRF52
Additional context
The iOS app was working before upgrading to Xcode 13.
I decided to change line 106 of
flutter_reactive_ble/packages/reactive_ble_mobile/ios/Classes/Plugin/PluginController.swift
from
else { assert(false); return }
to
else { }
and this made the iOS app work.
Obviously, "killing the messenger" is not ideal (given that the assertion is there for a reason) but, hey, . . .
The same Flutter app runs perfectly on Android.
pubspec.yaml:
name: xyz
description: XYZ
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.10.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_reactive_ble: ^4.0.1
location_permissions: ^4.0.0
typed_data: ^1.3.0
intl: ^0.17.0
dev_dependencies:
build_runner: ^2.1.2
dependency_validator: ^3.1.0
flutter_test:
sdk: flutter
# The following section is specific to Flutter.
flutter:
uses-material-design: true
Thanks for any guidance.