Search code examples
iosfluttercrashtestflight

Flutter app crashes on startup after deploying on Testflight


I have developed a Flutter app for both Android and ios on Linux. Everything works fine on Android but when I deploy my app on testflight(since I can't use an emulator), the app crashes on startup. I am deploying using codemagic CI/CD

these are the logs from the crashlogs file

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4305371136
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   1009ec000-1009f0000 [   16K] r-x/r-x SM=COW  ...er.app/Runner
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [1616]

Triggered by Thread:  0


Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
Thread 0 name:
Thread 0 Crashed:
0   libswiftCore.dylib              0x00000001a1462130 swift_getObjectType + 40 (SwiftObject.mm:129)
1   flutter_secure_storage          0x00000001016839b0 static SwiftFlutterSecureStoragePlugin.register(with:) + 108 (SwiftFlutterSecureStoragePlugin.swift:15)
2   flutter_secure_storage          0x0000000101683ba4 @objc static SwiftFlutterSecureStoragePlugin.register(with:) + 56 (<compiler-generated>:0)
3   flutter_secure_storage          0x000000010167fae8 +[FlutterSecureStoragePlugin registerWithRegistrar:] + 72 (FlutterSecureStoragePlugin.m:13)
4   Runner                          0x00000001009f0b88 +[GeneratedPluginRegistrant registerWithRegistry:] + 660 (GeneratedPluginRegistrant.m:134)
5   Runner                          0x00000001009f0ebc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 104 (AppDelegate.swift:14)
6   Runner                          0x00000001009f12fc @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 196 (<compiler-generated>:0)
7   UIKitCore                       0x00000001a96737e4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300 (UIApplication.m:2537)
8   UIKitCore                       0x00000001a9672f1c -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2848 (UIApplication.m:2968)
9   UIKitCore                       0x00000001a9671ef8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856 (UIApplication.m:4782)
10  UIKitCore                       0x00000001a9671b44 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 132 (_UISceneLifecycleMultiplexer.m:451)
11  UIKitCore                       0x00000001a93b9df4 _UIScenePerformActionsWithLifecycleActionMask + 112 (_UISceneLifecycleState.m:109)
12  UIKitCore                       0x00000001a96f7fe0 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 (_UISceneLifecycleMultiplexer.m:567)
13  UIKitCore                       0x00000001a95aa3ec -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220 (_UISceneLifecycleMultiplexer.m:516)
14  UIKitCore                       0x00000001a95aa214 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 (_UISceneLifecycleMultiplexer.m:566)
15  UIKitCore                       0x00000001a95a9dc4 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 (_UISceneLifecycleMultiplexer.m:469)
16  UIKitCore                       0x00000001a95a9c90 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 148 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:73)
17  UIKitCore                       0x00000001a9c96f50 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 (BSAnimationSettings+UIKit.m:54)
18  UIKitCore                       0x00000001a9d3549c _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 (_UISceneSettingsDiffAction.m:27)
19  UIKitCore                       0x00000001a9457400 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:58)
20  UIKitCore                       0x00000001a98c88e0 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.223 + 556 (UIScene.m:2007)
21  UIKitCore                       0x00000001a95283f0 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 (UIScene.m:1683)
22  UIKitCore                       0x00000001a9528260 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 (UIScene.m:1969)
23  UIKitCore                       0x00000001a95277b8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 520 (UIApplication.m:4231)
24  UIKitCore                       0x00000001a9527544 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288 (UIApplicationSceneClientAgent.m:47)
25  FrontBoardServices              0x00000001bd2f5220 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 344 (FBSScene.m:440)
26  FrontBoardServices              0x00000001bd334fe0 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.80 + 120 (FBSWorkspaceScenesClient.m:394)
27  FrontBoardServices              0x00000001bd2f905c -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FBSWorkspace.m:359)
28  FrontBoardServices              0x00000001bd334c38 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 360 (FBSWorkspaceScenesClient.m:393)
29  libdispatch.dylib               0x00000001ae77aeac _dispatch_client_callout + 20 (object.m:560)
30  libdispatch.dylib               0x00000001ae77e91c _dispatch_block_invoke_direct + 264 (queue.c:496)
31  FrontBoardServices              0x00000001bd303188 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:157)
32  FrontBoardServices              0x00000001bd302d24 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 (FBSSerialQueue.m:181)
33  FrontBoardServices              0x00000001bd3055d0 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:194)
34  CoreFoundation                  0x00000001a7382128 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
35  CoreFoundation                  0x00000001a738e7b4 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
36  CoreFoundation                  0x00000001a7313648 __CFRunLoopDoSources0 + 340 (CFRunLoop.c:2046)
37  CoreFoundation                  0x00000001a73290d4 __CFRunLoopRun + 828 (CFRunLoop.c:2953)
38  CoreFoundation                  0x00000001a732e3ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
39  GraphicsServices                0x00000001e1ec335c GSEventRunModal + 164 (GSEvent.c:2196)
40  UIKitCore                       0x00000001a96bb6e8 -[UIApplication _run] + 888 (UIApplication.m:3782)
41  UIKitCore                       0x00000001a96bb34c UIApplicationMain + 340 (UIApplication.m:5372)
42  Runner                          0x00000001009f1474 main + 64 (AppDelegate.swift:6)
43  dyld                            0x00000001c67f6dec start + 2220 (dyldMain.cpp:1165)

I got the same error for other package earlier so I tried again by removing it but now I am getting the error for other package

My pub dependencies

environment:
  sdk: ">=2.17.3 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  google_fonts: ^4.0.3
  webview_flutter: ^3.0.4
  http: ^0.13.4
  dio: ^5.1.0
  fluttertoast: ^8.0.7
  shared_preferences: ^2.0.15
  smooth_page_indicator: ^1.0.0+2
  expandable: ^5.0.1
  # flutter_html: ^2.2.1
  flutter_html: ^3.0.0-alpha.5
  flutter_svg: ^0.23.0+1
  auto_size_text: ^3.0.0
  intl: ^0.17.0
  flutter_slidable: ^0.6.0
  firebase_core: ^2.8.0
  firebase_messaging: ^14.3.0
  flutter_local_notifications: ^9.8.0+1
  # flutter_custom_tabs: ^1.2.1
  curved_navigation_bar: ^1.0.3
  flutter_widget_from_html: ^0.8.5
  flutter_native_splash: ^2.2.0+1
  firebase_auth: ^4.4.2
  flutter_secure_storage: ^8.0.0
  google_sign_in: ^6.1.0
  provider: ^6.0.5
  font_awesome_flutter: ^10.4.0
  firebase_crashlytics: ^3.1.2
  firebase_performance: ^0.9.1+1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  flutter_launcher_icons: ^0.10.0

flutter_native_splash:
  color: "#ffffff"
  image: "assets/appname.png"
flutter_icons:
  android: true
  ios: true
  image_path: "assets/appname.png"
  adaptive_icon_background: "#ffffff"
  adaptive_icon_foreground: "assets/appname.png"

flutter:

  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/google_logo.png
    - assets/images/
    - assets/images/integration_logo/

Solution

  • XCode is a must to setup Firebase properly for ios.

    Also, Flutter app will crash on ios14+ if the signing is done for debug mode. It worked fine after I signed it as "release"