Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginController.swift:106: Assertion failed #387

Closed
farr64 opened this issue Sep 27, 2021 · 1 comment
Closed

PluginController.swift:106: Assertion failed #387

farr64 opened this issue Sep 27, 2021 · 1 comment
Labels
bug Something isn't working iOS iOS-specific ticket

Comments

@farr64
Copy link

farr64 commented Sep 27, 2021

Describe the bug
PluginController.swift:106: Assertion failed

This started happening immediately upon upgrading to Xcode 13.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to one device using connectToAdvertisingDevice()
  2. Subscribe to a qualified characteristic
  3. 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.

@remonh87 remonh87 added bug Something isn't working iOS iOS-specific ticket labels Sep 28, 2021
@remonh87 remonh87 closed this as completed Oct 1, 2021
@farr64
Copy link
Author

farr64 commented Oct 1, 2021

Thanks to everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS iOS-specific ticket
Projects
None yet
Development

No branches or pull requests

2 participants