plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[connectivity_plus] crash on iOS: Sending a message before the FlutterEngine has been run.

Open OHeroJ opened this issue 3 years ago • 13 comments

flutter: 2.10.5 connectivity_plus: 2.3.0

Sending a message before the FlutterEngine has been run.

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x99d78 __exceptionPreprocess
1  libobjc.A.dylib                0x16734 objc_exception_throw
2  Foundation                     0x1311f0 _userInfoForFileAndLine
3  Flutter                        0x126c4 (缺少 UUID d24b4305a5d8348c8a0909c859505f3a)
4  Runner                         0x3859a4 thunk for @escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () (<compiler-generated>)
5  Runner                         0x3b670c partial apply for implicit closure #2 in implicit closure #1 in SwiftConnectivityPlusPlugin.init(connectivityProvider:) + 72 (SwiftConnectivityPlusPlugin.swift:72)
6  Runner                         0x3b4f1c partial apply for implicit closure #2 in implicit closure #1 in PathMonitorConnectivityProvider.ensurePathMonitor() (<compiler-generated>)
7  libswiftNetwork.dylib          0x361c0 closure #1 in NWPathMonitor.init(requiredInterfaceType:)
8  libswiftNetwork.dylib          0x2c80 thunk for @escaping @callee_guaranteed (@guaranteed OS_nw_path) -> ()
9  libnetwork.dylib               0x804ae0 __nw_path_necp_update_evaluator_block_invoke
10 libdispatch.dylib              0x1e68 _dispatch_call_block_and_release
11 libdispatch.dylib              0x3a2c _dispatch_client_callout
12 libdispatch.dylib              0x15280 _dispatch_root_queue_drain
13 libdispatch.dylib              0x1596c _dispatch_worker_thread2
14 libsystem_pthread.dylib        0x1080 _pthread_wqthread
15 libsystem_pthread.dylib        0xe5c start_wqthread

OHeroJ avatar May 16 '22 01:05 OHeroJ

Application Specific Information:
Sending a message before the FlutterEngine has been run.

Thread 37 Crashed:
0   CoreFoundation                  0x32f261d78         __exceptionPreprocess
1   libobjc.A.dylib                 0x360bae730         objc_exception_throw
2   Foundation                      0x3322d51ec         -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
3   Flutter                         0x1070de6c4         <redacted>
4   Runner                          0x2009059a4         __cxa_throw
5   Runner                          0x20093670c         __cxa_throw
6   Runner                          0x200934f1c         __cxa_throw
7   libswiftNetwork.dylib           0x411c3a1bc         NWPathMonitor.init
8   libswiftNetwork.dylib           0x411c06c7c         thunk for closure
9   libnetwork.dylib                0x33138aadc         __nw_path_necp_update_evaluator_block_invoke
10  libdispatch.dylib               0x32ebc3e64         _dispatch_call_block_and_release
11  libdispatch.dylib               0x32ebc5a28         _dispatch_client_callout
12  libdispatch.dylib               0x32ebd727c         _dispatch_root_queue_drain
13  libdispatch.dylib               0x32ebd7968         _dispatch_worker_thread2
14  libsystem_pthread.dylib         0x41215b07c         _pthread_wqthread
15  libsystem_pthread.dylib         0x41215ae58         start_wqthread

OHeroJ avatar May 16 '22 01:05 OHeroJ

Same here with Flutter v3.0.0. Already over 10k crash reports by Sentry in last 2 weeks due to this same thing.

MilosKarakas avatar May 20 '22 07:05 MilosKarakas

Same here, flutter v2.10.1, connectivity_plus: 2.3.0

netlsd avatar May 21 '22 04:05 netlsd

Can confirm that also see this issue in one of my projects. Not sure why it started to appear just in last 2 weeks, though.

The stacktrace from one of crashes in Crashlytics:

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x990fc __exceptionPreprocess
1  libobjc.A.dylib                0x15d64 objc_exception_throw
2  Foundation                     0x1303ac _userInfoForFileAndLine
3  Flutter                        0x161d0 (Missing UUID c25599caa061358c97027de2********)
4  connectivity_plus              0x8680 (Missing UUID 76fddfd7ffa7395296ef6fe7********)
5  connectivity_plus              0x92b0 (Missing UUID 76fddfd7ffa7395296ef6fe7********)
6  connectivity_plus              0x7870 (Missing UUID 76fddfd7ffa7395296ef6fe7********)
7  libswiftNetwork.dylib          0x34000 closure #1 in NWPathMonitor.init(requiredInterfaceType:)
8  libswiftNetwork.dylib          0x2ac4 thunk for @escaping @callee_guaranteed (@guaranteed OS_nw_path) -> ()
9  libnetwork.dylib               0x8357c4 __nw_path_necp_update_evaluator_block_invoke
10 libdispatch.dylib              0x2924 _dispatch_call_block_and_release
11 libdispatch.dylib              0x4670 _dispatch_client_callout
12 libdispatch.dylib              0x15f00 _dispatch_root_queue_drain
13 libdispatch.dylib              0x16608 _dispatch_worker_thread2
14 libsystem_pthread.dylib        0x10b8 _pthread_wqthread
15 libsystem_pthread.dylib        0xe94 start_wqthread

vbuberen avatar May 23 '22 07:05 vbuberen

Same here. We found in Crashlytics that many users experiencing this bug

image

-- We also found this bug, it looks very similar. I think it might be related:

image

subzero911 avatar May 30 '22 20:05 subzero911

Any updates guys?

nullhandler avatar May 31 '22 08:05 nullhandler

likely duplicated of https://github.com/fluttercommunity/plus_plugins/issues/766 and https://github.com/fluttercommunity/plus_plugins/issues/863

miquelbeltran avatar May 31 '22 13:05 miquelbeltran

Also seem related:

  • https://github.com/flutter/flutter/issues/66647
  • https://github.com/flutter/flutter/issues/90781
  • https://github.com/flutter/flutter/issues/96901

miquelbeltran avatar May 31 '22 13:05 miquelbeltran

He seems to have found a solution: https://github.com/flutter/flutter/issues/96901#issuecomment-1053114107 Why don't you implement it?

subzero911 avatar May 31 '22 18:05 subzero911

Why don't you implement it and submit a PR?

miquelbeltran avatar Jun 01 '22 05:06 miquelbeltran

unless people are still seeing this in 2.3.5, this should be able to be closed now

rmtmckenzie avatar Jul 01 '22 18:07 rmtmckenzie

@miquelbeltran can we implement the same logic to sensor_plus? Looks like the same error here

followthemoney1 avatar Jul 25 '22 08:07 followthemoney1

@followthemoney1 Feel free to submit a PR, tag me in it once you got it, so I can review it quickly

miquelbeltran avatar Jul 25 '22 08:07 miquelbeltran

Flutter version: 3.3.3 3.3.10 SDK version: 3.0.2

I have tried many methods, but they still don't work, and I feel that this problem only occurs on my computer:

Exception: Unable to launch com.niuke.flutterApp1 on 4F068ED4-3D84-47C6-9490-B01347FD1B03: ProcessException: Process exited abnormally: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1): The request to open "com.niuke.flutterApp1" failed. The request was denied by service delegate (SBMainWorkspace). Underlying error (domain=FBProcessExit, code=128): The operation couldn’t be completed. The process exited. The process exited. Command: xcrun simctl launch 4F068ED4-3D84-47C6-9490-B01347FD1B03 com.niuke.flutterApp1 --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0 Error launching application on iPhone 14 Pro Max. WechatIMG557

1076815296 avatar Dec 27 '22 08:12 1076815296

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Mar 28 '23 00:03 github-actions[bot]