Skip to content

Compiler errors are really ugly #58337

@Hixie

Description

@Hixie

At some point in the last few months we ended up making compiler errors much more ugly:

$ flutter create dummy_compiler_error
...
$ cd dummy_compiler_error
$ sed -i '$d' lib/main.dart
$ flutter run
Launching lib/main.dart on Lenovo TB 8504F in debug mode...
Running Gradle task 'assembleDebug'...                          

Compiler message:

lib/main.dart:52:50: Error: Can't find '}' to match '{'.

class _MyHomePageState extends State<MyHomePage> {

                                                 ^



Compiler message:

lib/main.dart:52:50: Error: Can't find '}' to match '{'.

class _MyHomePageState extends State<MyHomePage> {

                                                 ^

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null

build failed.



FAILURE: Build failed with an exception.



* Where:

Script '/home/ianh/dev/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896



* What went wrong:

Execution failed for task ':app:compileFlutterBuildDebug'.

> Process 'command '/home/ianh/dev/flutter/bin/flutter'' finished with non-zero exit value 1



* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.



* Get more help at https://help.gradle.org



BUILD FAILED in 7s
Running Gradle task 'assembleDebug'...                              8.4s
Exception: Gradle task assembleDebug failed with exit code 1

The very first error message happens very quickly. We should abort there. Instead we seem to try to compile again, and then try to do something else in gradle, not sure what.

cc @jonahwilliams

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencet: gradle"flutter build" and "flutter run" on Androidteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy