Skip to content

No exceptions logged before runApp on iOS devices #44717

Description

@stx

Exceptions that occur before runApp() are not printed to log on iOS devices. Works in simulator.

Related: #41133

Reproduce:

void main() {
  throw Exception('an error happened here');
  runApp(MyApp());
}

Result is a frozen app and nothing in the logs.

[✓] Flutter (Channel master, v1.10.16-pre.98, on Mac OS X 10.15.1 19B88, locale en-US)
    • Flutter version 1.10.16-pre.98 at /Users/james/Development/flutter
    • Framework revision 03ac37af08 (2 hours ago), 2019-11-08 12:47:26 -0800
    • Engine revision 5f5713e339
    • Dart version 2.7.0

 
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/james/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.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-1343-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2, Build version 11B52
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 38.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

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

[✓] Connected device (1 available)
    • Virgo • 00008030-000848D11EF0802E • ios • iOS 13.2.2

! Doctor found issues in 1 category.

Activity

  1. added
    a: debuggingDebugging, breakpoints, expression evaluation
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-iosiOS applications specifically
    on Nov 12, 2019
  2. changed the title [-]No exceptions logged before runApp on iOS devices[/-] [+]No exceptions or logs logged before runApp on iOS devices[/+] on Nov 12, 2019
  3. jmagman commented on Nov 12, 2019

    @jmagman
    Member

    @stx Also mentioned this is for logs as well as exceptions in #44718:

    void main() {
      print("here's a message");
      print("here's a second message");
      runApp(MyApp());
    }
    
  4. stx commented on Nov 12, 2019

    @stx
    Author

    @jmagman These might be at least slightly separate problems.

    Exceptions pre-runApp never get printed as far as I can tell.

    Logs pre-runApp do get printed on hot restart, but never on first build. May apply to exceptions also, but can't test it due to the above.

  5. jmagman commented on Nov 12, 2019

    @jmagman
    Member

    Okay, will track separately then. Thanks for the clarification.

  6. changed the title [-]No exceptions or logs logged before runApp on iOS devices[/-] [+]No exceptions logged before runApp on iOS devices[/+] on Nov 13, 2019
  7. jmagman commented on Mar 17, 2020

    @jmagman
    Member

    ios-deploy can attach via lldb, maybe we can get stream in the os logs that way...

  8. added
    P2Important issues not at the top of the work list
    on Aug 18, 2020
  9. github-actions commented on Aug 12, 2021

    @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.

  10. locked as resolved and limited conversation to collaborators on Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: debuggingDebugging, breakpoints, expression evaluationplatform-iosiOS applications specificallytoolAffects 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