1

I am trying to follow the steps to connect Firebase to an iOS App generated by Flutter.

In the final step, when adding the line FirebaseApp.configure() into the AppDelegate.swift file, the App builds OK, but then crashes upon execution, indicating a Signal Abortion on Thread 1... Thread 1: signal SIGABRT

The code in AppDelegate.swift is the following:

import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    FirebaseApp.configure()
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    };
}

The full Error log provided by Xcode is the following:

2019-11-18 07:11:34.664822-0500 Runner[82048:876634]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-11-18 07:11:34.849351-0500 Runner[82048:876630] 6.13.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2019-11-18 07:11:34.860414-0500 Runner[82048:876433] *** Terminating app due to uncaught exception 'com.firebase.core', reason: '`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23c4f02e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50b97b20 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23c4ee6c +[NSException raise:format:] + 188
    3   Runner                              0x00000001040bf51a +[FIRApp configure] + 138
    4   Runner                              0x00000001040baea4 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 212
    5   Runner                              0x00000001040bb1f4 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 212
    6   UIKitCore                           0x00007fff47846788 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
    7   UIKitCore                           0x00007fff47848197 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3980
    8   UIKitCore                           0x00007fff4784dce6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1281
    9   UIKitCore                           0x00007fff46f843c9 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
    10  UIKitCore                           0x00007fff47471be1 _UIScenePerformActionsWithLifecycleActionMask + 83
    11  UIKitCore                           0x00007fff46f84edb __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
    12  UIKitCore                           0x00007fff46f848ea -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
    13  UIKitCore                           0x00007fff46f84d08 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
    14  UIKitCore                           0x00007fff46f8459d -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
    15  UIKitCore                           0x00007fff46f88bcb __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
    16  UIKitCore                           0x00007fff4739769b +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 865
    17  UIKitCore                           0x00007fff4749051f _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
    18  UIKitCore                           0x00007fff46f888e6 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
    19  UIKitCore                           0x00007fff47490422 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
    20  UIKitCore                           0x00007fff46f88754 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
    21  UIKitCore                           0x00007fff46ddf123 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
    22  UIKitCore                           0x00007fff46dddca8 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
    23  UIKitCore                           0x00007fff46ddee4d -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
    24  UIKitCore                           0x00007fff4784c343 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 535
    25  UIKitCore                           0x00007fff473b920d -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    26  FrontBoardServices                  0x00007fff36555225 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 442
    27  FrontBoardServices                  0x00007fff3657b598 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
    28  FrontBoardServices                  0x00007fff3655fd05 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
    29  FrontBoardServices                  0x00007fff3657b229 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
    30  libdispatch.dylib                   0x00000001070ebd48 _dispatch_client_callout + 8
    31  libdispatch.dylib                   0x00000001070eecb9 _dispatch_block_invoke_direct + 300
    32  FrontBoardServices                  0x00007fff365a143e __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    33  FrontBoardServices                  0x00007fff365a112c -[FBSSerialQueue _queue_performNextIfPossible] + 441
    34  FrontBoardServices                  0x00007fff365a163b -[FBSSerialQueue _performNextFromRunLoopSource] + 22
    35  CoreFoundation                      0x00007fff23bb2221 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    36  CoreFoundation                      0x00007fff23bb214c __CFRunLoopDoSource0 + 76
    37  CoreFoundation                      0x00007fff23bb1924 __CFRunLoopDoSources0 + 180
    38  CoreFoundation                      0x00007fff23bac62f __CFRunLoopRun + 1263
    39  CoreFoundation                      0x00007fff23babe16 CFRunLoopRunSpecific + 438
    40  GraphicsServices                    0x00007fff38438bb0 GSEventRunModal + 65
    41  UIKitCore                           0x00007fff4784fb48 UIApplicationMain + 1621
    42  Runner                              0x00000001040bb45b main + 75
    43  libdyld.dylib                       0x00007fff51a1dc25 start + 1
    44  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

A very interesting line in the above Error log:

Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure]; (FirebaseApp.configure() in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'

So... That message clearly suggests that there may be some issue with the GoogleService-Info.plist, like if it wasn't present... except that it IS indeed present, freshly downloaded from Firebase, it is located in the correct folder, and I have thoroughly reviewed the contents of the plist to verify the Bundle ID, Team ID and all other info is correct...

May anyone kindly please offer some suggestion to solve this problem?

THANKS

4
  • 2
    Have you made sure that the GoogleService-Info.plist is included to your target? Commented Nov 18, 2019 at 13:01
  • yes !!! thank you for your comment... indeed, reading that error message, it is the first thing one would think... BUT, the GoogleService-Info.plist IS indeed present, freshly downloaded from Firebase, it is located in the correct folder, and I have thoroughly reviewed the contents of the plist to verify the Bundle ID, Team ID and all other info is correct... which is what makes this issue a bit curious, in my perception, and the reason why I thought about asking the community herein... Commented Nov 18, 2019 at 17:53
  • 1
    This error usually occurs when the file is not included in the target. Just having the file in your project in the right location doesn’t mean it is included in your target. Commented Nov 18, 2019 at 18:34
  • Thank you immensely, Andrew. Your comment is very valuable indeed. If you would please so kindly help me better understand, how to make sure that the file is included in the target? I am totally new to Xcode, and such thing doesn't seem to happen in AndroidStudio, with which I´m famiiar... Commented Nov 18, 2019 at 18:51

2 Answers 2

5

To check that you have included the file in your target do the following

  1. Click on the file that you are checking
  2. Click on the file inspector
  3. Check that the file is included in your required target. Most apps only have one target.

image showing locations

Sign up to request clarification or add additional context in comments.

4 Comments

Mr. Andrew, most truly I wish to express my sincere gratitude for your kindness, taking the time to elaborate this beautiful simple 1, 2, 3 step explanatory image... THANK YOU !!! your solution has indeed pointed to where the issue was... mainly, what I was doing wrong is that I was pasting that GoogleService-Info.plist into the project using the Finder... and, as it turns out, it wasn't even visible within Xcode... so, I had to add the file through Xcode, not copy/paste but specifically using the drop menu to add a file into the project, and then it worked OK... again, THANK YOU !!!
it's like when you learn the answer to a fun riddle... in retrospective it just seems obvious... but, being new to Xcode, I really didn't know that one had to add files, only using the internal feature of the program...
in comparison, when using AndroidStudio, if you just copy paste a file into the folder, and then you open the project, the system picks your file, it's visible and functional, and you don't need to verify target or anything like that...
guess I have just grown a bit lazy, far too much used to AndroidStudio style of programming, which I find quite easy, intuitive and straight-forward... possibly, if I had my way, I would never choose to program for iOS, I'd be perfectly happy delivering for Android alone... but, as it still presently happens, when you are developing Apps your clients fiercely demand that you also provide an iOS version, like it's a life or death imperative... which is the reason why I am learning Flutter, and learning the intriguing obscure (to me) ways of Xcode... again, Mr. Andrew, thank you immensely !!!
1

When I attempted to add the FirebaseApp.configure() statement to my AppDelegate.swift file, the project would no longer build. So I removed those statements and continued on with the Firebase/Analytics setup. My app was able to eventually communicate with the Firebase server without that statement. It looks like the firebase plugins must be doing that for us. I added both firebase_core and firebase_analytics to my pubspec.yaml as:

  firebase_core: ^0.4.0+9
  firebase_analytics:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.