flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [Firebase Crashlytics] HandshakeException: Connection terminated during handshake

Open SdxCoder opened this issue 1 year ago • 5 comments

Bug report

Describe the bug We have our app in production and getting this error time to time that HandshakeException: Connection terminated during handshake. Firebase Crashlytics console reports that this is happening when device was in background. Here is the compete crash log

# Crashlytics - Stack trace
# Application: hmg.mep.pharmacy
# Platform: apple
# Version: 1.30.0 (30)
# Issue: a175337881dd6650d82ca3c454ea5dcd
# Session: 367b97dfd1634a1da6191126ceda896b_DNE_0_v2
# Date: Mon Feb 05 2024 21:33:45 GMT-0700 (Mountain Standard Time)

Fatal Exception: FlutterError
0  ???                            0x0 FirebaseCrashlytics.recordError + 119 (firebase_crashlytics.dart:119)
1  ???                            0x0 new FirebaseCrashlyticsConfiguration.initialize.<fn> + 13 (firebase_crashlytics_configuration.dart:13)

Crashed: com.apple.main-thread
0  FirebaseCrashlytics            0x214f4 FIRCLSProcessRecordAllThreads + 184
1  FirebaseCrashlytics            0x218d4 FIRCLSProcessRecordAllThreads + 1176
2  FirebaseCrashlytics            0x18a04 FIRCLSHandler + 48
3  FirebaseCrashlytics            0x12eb4 FIRCLSExceptionRecordOnDemand + 1328
4  FirebaseCrashlytics            0x128f4 FIRCLSExceptionRecordOnDemandModel + 228
5  FirebaseCrashlytics            0x20cc0 -[FIRCLSOnDemandModel recordOnDemandExceptionWithModel:] + 68
6  FirebaseCrashlytics            0x20720 -[FIRCLSOnDemandModel recordOnDemandExceptionIfQuota:withDataCollectionEnabled:usingExistingReportManager:] + 164
7  FirebaseCrashlytics            0x2eb34 -[FIRCrashlytics recordOnDemandExceptionModel:] + 140
8  Runner                         0x4f3ea0 -[FLTFirebaseCrashlyticsPlugin recordError:withMethodCallResult:] + 177 (FLTFirebaseCrashlyticsPlugin.m:177)
9  Runner                         0x4f375c -[FLTFirebaseCrashlyticsPlugin handleMethodCall:result:] + 101 (FLTFirebaseCrashlyticsPlugin.m:101)
10 Flutter                        0x5e1a38 InternalFlutterGpuTestClass_Method + 5940
11 Flutter                        0x43c00 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
12 libdispatch.dylib              0x26a8 <redacted> + 32
13 libdispatch.dylib              0x4300 <redacted> + 20
14 libdispatch.dylib              0x12998 <redacted> + 984
15 libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
16 CoreFoundation                 0x36f9c <redacted> + 16
17 CoreFoundation                 0x33ca8 <redacted> + 1996
18 CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
19 GraphicsServices               0x34f8 GSEventRunModal + 164
20 UIKitCore                      0x22c8a0 <redacted> + 888
21 UIKitCore                      0x22bedc UIApplicationMain + 340
22 Runner                         0x99c8 main + 9 (AppDelegate.swift:9)
23 ???                            0x1c27e2dcc (Missing)

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35a9c <redacted> + 160
5  CoreFoundation                 0x33994 <redacted> + 1208
6  CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
7  Foundation                     0x2c3ec <redacted> + 212
8  Foundation                     0x596ac <redacted> + 64
9  UIKitCore                      0x18e710 <redacted> + 420
10 Foundation                     0xafd40 <redacted> + 732
11 libsystem_pthread.dylib        0x24d4 _pthread_start + 136
12 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.ui
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35a9c <redacted> + 160
5  CoreFoundation                 0x33994 <redacted> + 1208
6  CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
7  Flutter                        0x2e95e8 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
8  Flutter                        0x2e8c5c (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.raster
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35a9c <redacted> + 160
5  CoreFoundation                 0x33994 <redacted> + 1208
6  CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
7  Flutter                        0x2e95e8 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
8  Flutter                        0x2e8c5c (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.flutter.1.io
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35a9c <redacted> + 160
5  CoreFoundation                 0x33994 <redacted> + 1208
6  CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
7  Flutter                        0x2e95e8 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
8  Flutter                        0x2e8c5c (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.1
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.2
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.3
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.4
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.5
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.6
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

dart:io EventHandler
0  libsystem_kernel.dylib         0xef0c kevent + 8
1  Flutter                        0x5a1ed4 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
2  Flutter                        0x5cf9c8 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
4  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.1
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.2
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.3
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

io.worker.4
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0xfd4 <redacted> + 1228
2  Flutter                        0x570fc (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
3  Flutter                        0x2e28b0 (Missing UUID 4c4c44d255553144a1077b9e8f9e2ff7)
4  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
5  libsystem_pthread.dylib        0x1a10 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  FirebaseCrashlytics            0x1b040 FIRCLSMachExceptionServer + 104
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1178 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xf10 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xe28 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc68 mach_msg + 24
4  CoreFoundation                 0x35a9c <redacted> + 160
5  CoreFoundation                 0x33994 <redacted> + 1208
6  CoreFoundation                 0x333f8 CFRunLoopRunSpecific + 608
7  CFNetwork                      0x25a050 estimatedPropertyListSize + 38188
8  Foundation                     0xafd40 <redacted> + 732
9  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
10 libsystem_pthread.dylib        0x1a10 thread_start + 8

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

Thread
0  libsystem_pthread.dylib        0x19fc _pthread_wqthread + 438

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 <redacted> + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

DartWorker
0  libsystem_kernel.dylib         0x1b1c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1000 <redacted> + 1272
2  Flutter                        0x697558 InternalFlutterGpuTestClass_Method + 750164
3  Flutter                        0x6d2068 InternalFlutterGpuTestClass_Method + 990564
4  Flutter                        0x696f24 InternalFlutterGpuTestClass_Method + 748576
5  libsystem_pthread.dylib        0x24d4 _pthread_start + 136
6  libsystem_pthread.dylib        0x1a10 thread_start + 8

Steps to reproduce

Steps to reproduce the behavior:

  1. We don't have clear steps for reproduction as this is coming from firebase console, however, open the the app from the public git repo. You will need to connect your own firebase with that.
  2. Press Throw Exception Button and put your iphone app in background.
  3. Observe the behaviour.

Expected Behavior

No exception should be thrown.

Sample project

https://github.com/SdxCoder/handshake_exception_demo


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

[✓] Flutter (Channel stable, 3.16.9, on macOS 14.1.1 23B81 darwin-arm64, locale
    en-CA)
    • Flutter version 3.16.9 on channel stable at /Users/saadahmed/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (12 days ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/saadahmed/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.86.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.82.0

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • D116D051-A3AE-4B72-9299-766130C75945 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 121.0.6167.139

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 3.2.6
Flutter SDK 3.16.9
handshake_exception_demo 1.0.0+1

dependencies:
- cupertino_icons 1.0.6
- firebase_core 2.11.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.2.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine]
- get_it 7.6.7 [async collection]
- injectable 2.3.2 [get_it]

dev dependencies:
- build_runner 2.4.8 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_lints 2.0.3 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web]
- injectable_generator 2.4.1 [build source_gen path glob analyzer code_builder dart_style injectable collection recase meta]

transitive dependencies:
- _fe_analyzer_shared 64.0.0 [meta]
- _flutterfire_internals 1.2.0 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 6.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- args 2.4.2
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.3.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.9.0 [built_collection collection fixnum meta]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- clock 1.1.1
- code_builder 4.10.0 [built_collection built_value collection matcher meta]
- collection 1.18.0
- convert 3.1.1 [typed_data]
- crypto 3.0.3 [typed_data]
- dart_style 2.3.4 [analyzer args collection path pub_semver source_span]
- fake_async 1.3.1 [clock collection]
- file 7.0.0 [meta path]
- firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.8.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.5.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- fixnum 1.1.0
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- frontend_server_client 3.2.0 [async path]
- glob 2.1.2 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- io 1.0.4 [meta path string_scanner]
- js 0.6.7 [meta]
- json_annotation 4.8.1 [meta]
- lints 2.1.1
- logging 1.2.0
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.10.0
- mime 1.0.5
- package_config 2.1.0 [path]
- path 1.8.3
- plugin_platform_interface 2.1.8 [meta]
- pool 1.5.1 [async stack_trace]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- recase 4.1.0
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml]
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- vector_math 2.1.4
- watcher 1.1.0 [async path]
- web 0.3.0
- web_socket_channel 2.4.0 [async crypto stream_channel]
- yaml 3.1.2 [collection source_span string_scanner]

SdxCoder avatar Feb 06 '24 19:02 SdxCoder

Thanks for the report @SdxCoder I looked at the sample project you shared and it seems to contain third party package implementation like get_it, but in order to confirm whether the exception is indeed occuring only using firebase_crashlytics plugin itself, we would need a minimal reproducible code sample without any third party package code. If you can confirm that the exception still occurs without any outside code implementation, we can then properly address it.

Also, you can try implementing a runZonedGuard like below and check if using it, you still get the same crash or not:

await runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
    runApp(MyApp());
  }, (error, stackTrace) {
    FirebaseCrashlytics.instance.recordError(error, stackTrace);
  });

darshankawar avatar Feb 07 '24 11:02 darshankawar

Thanks @darshankawar for reaching out. I have updated the repo, removed third party integration https://github.com/SdxCoder/handshake_exception_demo

Can you kindly check into it again. Thanks

SdxCoder avatar Feb 11 '24 17:02 SdxCoder

you can try implementing a runZonedGuard like below and check if using it, you still get the same crash or not:

Did you get a chance to use above in your code to check if it catches the error or gives any meaningful log that'll be helpful ?

darshankawar avatar Feb 12 '24 12:02 darshankawar

@darshankawar i did used the code and deployed the suggested fix to production app. If we get the same crash again going forward, i will share logs. Unfortunately we only have firebase crash logs and no clear reproducible steps for that.

SdxCoder avatar Feb 12 '24 18:02 SdxCoder

Thanks for the update. I wasn't able to replicate the repo you shared after updating it with my local firebase_options and running on iphone 6s (OS 15.3). Revisiting your original description, since you are getting handshake error and timeout, do you know how long the app stays in background ? because depending on the duration, the connection may be losing resulting in timeout.

darshankawar avatar Feb 13 '24 11:02 darshankawar

Hey @SdxCoder. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Feb 22 '24 02:02 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@SdxCoder if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Mar 04 '24 02:03 google-oss-bot

Hello @darshankawar, we used the code shared by you and we observed crash logs for couple of weeks and we still have this crash coming. But this time error logs is this

Crash Log
Crashlytics - Stack trace
 Application: hmg.mep.pharmacy
 Platform: apple
 Version: 1.33.0 (33)
 Issue: 04760bcc99c3d20ef9db9f3ee646ad13
 Session: 8adc52b968d54cd6bc335eff7517648f_DNE_0_v2
 Date: Tue Mar 19 2024 13:54:56 GMT-0600 (Mountain Daylight Time)

Non-fatal Exception: FlutterError
0  ???                            0x0 FirebaseCrashlytics.recordError + 119 (firebase_crashlytics.dart:119)
1  ???                            0x0 mainCommon.<fn> + 40 (main_common.dart:40)

The line it refers to is this

 await runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
    FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
    HttpOverrides.global = PostHttpOverrides();
    await Firebase.initializeApp();
    await Helper.useAndroidViewSurfaceForGoogleMaps();
    await configureDependencies();
    FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler);
    _setupLogging();
    runApp(
      ProviderScope(
        child: DevicePreview(
          enabled: false,
          builder: (context) => Phoenix(child: const App()),
        ),
      ),
    );
  }, (error, stackTrace) {
    FirebaseCrashlytics.instance.recordError(error, stackTrace);  <--------------------- LINE 40
  });

SdxCoder avatar Mar 24 '24 21:03 SdxCoder