Skip to content

flutter run doesn't show some critical log items from Xcode #22536

Closed

Description

@filiph

Steps to Reproduce

  1. Create an app using Firestore (cloud_firestore in dependencies). For example, the official Firebase for Flutter codelab.
  2. Neglect to set up the iOS project with GoogleService-Info.plist.
  3. flutter run the app on iOS.

Logs

This is what flutter run shows, in its entirety:

Launching lib/main.dart on iPhone X in debug mode...
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010930d29b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x00000001088a9735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010930d0f5 +[NSException raise:format:] + 197
	3   Runner                              0x0000000104947aa1 +[FIRApp configure] + 481
	4   Runner                              0x0000000104c9d22c -[FLTCloudFirestorePlugin init] + 188
	5   Runner                              0x0000000104c9d0d9 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
	6   Runner                              0x00000001048f06bb +[GeneratedPluginRegistrant registerWithRegistry:] + 123
	7   Runner                        <…>
Starting Xcode build...
Xcode build done.
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010665829b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000105bf4735 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001066580f5 +[NSException raise:format:] + 197
	3   Runner                              0x0000000101befaa1 +[FIRApp configure] + 481
	4   Runner                              0x0000000101f4522c -[FLTCloudFirestorePlugin init] + 188
	5   Runner                              0x0000000101f450d9 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
	6   Runner                              0x0000000101b986bb +[GeneratedPluginRegistrant registerWithRegistry:] + 123
	7   Runner                        <…>

Here's what you get in Xcode:

2018-10-01 16:30:54.093692-0700 Runner[21990:12461249]  - <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
2018-10-01 16:30:54.370913-0700 Runner[21990:12460659] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
2018-10-01 16:30:54.371112-0700 Runner[21990:12460659] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2018-10-01 16:30:54.385564-0700 Runner[21990:12460659] *** 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                      0x000000010ac0529b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x000000010a1a1735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010ac050f5 +[NSException raise:format:] + 197
	3   Runner                              0x0000000105fe9aa1 +[FIRApp configure] + 481
	4   Runner                              0x000000010633f22c -[FLTCloudFirestorePlugin init] + 188
	5   Runner                              0x000000010633f0d9 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
	6   Runner                              0x0000000105f926bb +[GeneratedPluginRegistrant registerWithRegistry:] + 123
	7   Runner                              0x0000000105f927ca $S6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 138
	8   Runner                              0x0000000105f92bb4 $S6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 228
	9   UIKitCore                           0x00000001133ac4d7 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
	10  UIKitCore                           0x00000001133adec4 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3979
	11  UIKitCore                           0x00000001133b3527 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1623
	12  UIKitCore                           0x0000000113c55e3e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
	13  UIKitCore                           0x0000000113c52403 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
	14  UIKitCore                           0x0000000113c55a7b -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
	15  UIKitCore                           0x0000000113c56435 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
	16  UIKitCore                           0x0000000113c13b31 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
	17  UIKitCore                           0x0000000113c137db -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
	18  UIKitCore                           0x0000000113c5892c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
	19  UIKitCore                           0x0000000113c59256 _performActionsWithDelayForTransitionContext + 100
	20  UIKitCore                           0x0000000113c5868b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
	21  UIKitCore                           0x0000000113c51aa1 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
	22  UIKitCore                           0x00000001133b1d46 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
	23  UIKitCore                           0x00000001133e3856 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
	24  FrontBoardServices                  0x00000001166aedda -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
	25  FrontBoardServices                  0x00000001166b9f43 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
	26  FrontBoardServices                  0x00000001166b963a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
	27  libdispatch.dylib                   0x000000010c64e63e _dispatch_client_callout + 8
	28  libdispatch.dylib                   0x000000010c651bb4 _dispatch_block_invoke_direct + 301
	29  FrontBoardServices                  0x00000001166ee3c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
	30  FrontBoardServices                  0x00000001166ee080 -[FBSSerialQueue _performNext] + 457
	31  FrontBoardServices                  0x00000001166ee660 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
	32  CoreFoundation                      0x000000010ab68b31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	33  CoreFoundation                      0x000000010ab683a3 __CFRunLoopDoSources0 + 243
	34  CoreFoundation                      0x000000010ab62a4f __CFRunLoopRun + 1263
	35  CoreFoundation                      0x000000010ab62221 CFRunLoopRunSpecific + 625
	36  GraphicsServices                    0x000000010fcd01dd GSEventRunModal + 62
	37  UIKitCore                           0x00000001133b5115 UIApplicationMain + 140
	38  Runner                              0x0000000105f92d84 main + 68
	39  libdyld.dylib                       0x000000010c6c4551 start + 1
)
2018-10-01 16:30:54.489749-0700 Runner[21990:12461272] flutter: Observatory listening on http://127.0.0.1:49397/
libc++abi.dylib: terminating with uncaught exception of type NSException
2018-10-01 16:30:54.404948-0700 Runner[21990:12461249] 5.6.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.

Note the helpful error that is only visible in Xcode:

could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/

Flutter doctor

$ flutter doctor -v
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.8.2 at /Users/filiph/dev/flutter
    • Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/filiph/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 28.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[!] IntelliJ IDEA Community Edition (version 2018.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.22.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected devices (3 available)
    • Pixel 2 XL • 711KPZK0592485                       • android-arm64 • Android 9 (API 28)
    • iPhone X   • A4DBE660-4C39-4AEA-B258-7755F584BA6E • ios           • iOS 12.0 (simulator)
    • iPhone XR  • 431DF6F4-BF91-4E1D-9AF1-8324CF683D37 • ios           • iOS 12.0 (simulator)

! Doctor found issues in 2 categories.

Activity

  1. added
    c: crashStack traces logged to the console
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Oct 2, 2018
  2. added this to the milestone on Oct 2, 2018
  3. Dandidodo commented on Oct 12, 2018

    @Dandidodo
  4. yathit commented on Oct 29, 2018

    @yathit
  5. added
    t: xcode"xcodebuild" on iOS and general Xcode project management
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 5, 2019
  6. kangwang1988 commented on Jan 5, 2019

    @kangwang1988
  7. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 8, 2019
  8. rajhraval commented on May 31, 2019

    @rajhraval
  9. ahmadsadeed commented on Jul 31, 2019

    @ahmadsadeed
  10. Hemistone commented on Jan 6, 2020

    @Hemistone
  11. jmagman commented on Jan 22, 2020

    @jmagman
    Member

    Similar to #19196.

  12. jeeali commented on Apr 9, 2020

    @jeeali
  13. hyochan commented on Apr 24, 2020

    @hyochan
  14. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  15. removed this from the milestone on Aug 17, 2020
  16. jmagman commented on Sep 28, 2020

    @jmagman
    Member

    We're going to use this issue to track improving Xcode output, not the GoogleService-Info.plist issue specifically.

  17. jmagman commented on Sep 28, 2020

    @jmagman
    Member
    xcrun xcodebuild -workspace Runner.xcworkspace -scheme Runner -resultBundlePath ./output -resultBundleVersion 3
    xcrun xcresulttool get --path output --format json
    

    Need to parse ['actions']['_values'][0]['buildResult']['issues'] for warningSummaries and errorSummaries.

    xcresulttool-output.txt

    See also https://chromium.googlesource.com/chromium/src/+/HEAD/ios/build/bots/scripts/xcode_log_parser.py.

  18. xster commented on Sep 29, 2020

    @xster
    Member

    I've been noticing this cluster of issues more recently. Don't know if it's due to an xcode change. The actual error tends to be very unassumingly buried in a wall of text. This likely produces a bunch of red herrings for users. This is a great project to pursue.

  19. jmagman commented on Dec 15, 2020

    @jmagman
    Member

    The errorSummaries are really lacking for errors coming from dart.

    This nice compilation error:

        /bin/sh -c /Users/magder/Library/Developer/Xcode/DerivedData/Runner-asrszkthjhuqfdcyidwleqxjtniu/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh
    lib/gallery/app.dart:141:7: Error: Expected ',' before this.
          model: model,
          ^^^^^
    lib/gallery/app.dart:139:38: Error: Too many positional arguments: 0 allowed, but 1 found.
    Try removing the extra positional arguments.
        return ScopedModel<AppStateModel>(
                                         ^
    ../../../../../.pub-cache/git/scoped_model-cc39449cdea9364f574713009ef6d2c40a7d35a7/lib/scoped_model.dart:113:3: Context: Found this candidate, but the arguments don't match.
      ScopedModel({required this.model, required this.child});
    
    Command PhaseScriptExecution failed with a nonzero exit code
    

    Is recorded as:

    "errorSummaries" : {
      "_type" : {
        "_name" : "Array"
      },
      "_values" : [
        {
          "_type" : {
            "_name" : "IssueSummary"
          },
          "issueType" : {
            "_type" : {
              "_name" : "String"
            },
            "_value" : "Uncategorized"
          },
          "message" : {
            "_type" : {
              "_name" : "String"
            },
            "_value" : "Command PhaseScriptExecution failed with a nonzero exit code"
          }
        }
      ]
    },
  20. eliabieri commented on Jan 15, 2021

    @eliabieri
  21. self-assigned this
    on Oct 20, 2021
  22. github-actions commented on Jan 4, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: triage improvementsMake GitHub issues easier to triage and more actionablec: crashStack traces logged to the consoleplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions