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

Sending a message before the FlutterEngine has been run. #59

Open
ErayAltas opened this issue Nov 16, 2023 · 1 comment
Open

Sending a message before the FlutterEngine has been run. #59

ErayAltas opened this issue Nov 16, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ErayAltas
Copy link

Issue:
Fatal Exception: NSInternalInconsistencyException
Sending a message before the FlutterEngine has been run.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x9cb4 __exceptionPreprocess
1 libobjc.A.dylib 0x183d0 objc_exception_throw
2 Foundation 0x4e154c userInfoForFileAndLine
3 Flutter 0x1ba6c (Missing UUID 4c4c44c655553144a12489c324693308)
4 Flutter 0x5d75e0 (Missing UUID 4c4c44c655553144a12489c324693308)
5 live_activities 0x4470 thunk for @escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () ()
6 live_activities 0xa458 (3) suspend resume partial function for specialized closure #1 in SwiftLiveActivitiesPlugin.monitorLiveActivity(
:) + 359 (SwiftLiveActivitiesPlugin.swift:359)
7 live_activities 0x1381d (1) await resume partial function for partial apply for specialized closure #1 in SwiftLiveActivitiesPlugin.monitorLiveActivity(_:)
8 live_activities 0xb8f1 (1) await resume partial function for specialized thunk for @escaping @callee_guaranteed @sendable @async () -> (@out A) ()
9 live_activities 0x13865 (1) await resume partial function for partial apply for specialized thunk for @escaping @callee_guaranteed @sendable @async () -> (@out A)
10 libswift_Concurrency.dylib 0x48dd9 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*)

Issue on swift file, it points this function:

@available(iOS 16.1, *)
private func monitorLiveActivity(_ activity: Activity) {
Task {
for await state in activity.activityStateUpdates {
var response: Dictionary<String, Any> = Dictionary()
response["activityId"] = activity.id
switch state {
case .active:
monitorTokenChanges(activity)
case .dismissed, .ended:
response["status"] = "ended"
activityEventSink?.self(response)
case .stale:
response["status"] = "stale"
activityEventSink?.self(response)
@unknown default:
response["status"] = "unknown"
activityEventSink?.self(response)
}
}
}
}

The application crashes because of this line.

I think the reason for this is that when the Flutter application is closed, the live activity is also tried to be closed, but this error may occur because the Flutter app disappears first and the live activity update is tried to be transmitted to the Flutter app later.

The error line
////
case .dismissed, .ended:
response["status"] = "ended"
activityEventSink?.self(response)
/////

@istornz istornz added the bug Something isn't working label Dec 7, 2023
@ggirotto
Copy link
Contributor

ggirotto commented Jan 5, 2024

I strongly believe this is related with Flutter engine. See flutter/flutter#117523 for a more in-depth discussions. There's nothing we can do but wait...

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

No branches or pull requests

3 participants