Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error on flutter run causes tool to crash #44963

Closed
Hixie opened this issue Nov 15, 2019 · 3 comments · Fixed by #44966
Closed

Compiler error on flutter run causes tool to crash #44963

Hixie opened this issue Nov 15, 2019 · 3 comments · Fixed by #44966
Labels
a: first hour The first hour of using Flutter c: crash Stack traces logged to the console c: regression It was better in the past than it is now t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Hixie
Copy link
Contributor

Hixie commented Nov 15, 2019

  1. flutter create compiler_crash
  2. Replace lib/main.dart with:
import 'package:flutter/material.dart';

void main() => runApp(test: null);
  1. In the compiler_crash/ directory, run flutter run.

Output:

$ flutter run
Launching lib/main.dart on Pixel 3 XL in debug mode...
Running Gradle task 'assembleDebug'...                          


Compiler message:

lib/main.dart:3:22: Error: Too few positional arguments: 1 required, 0 given.

void main() => runApp(test: null);

                     ^

../flutter/packages/flutter/lib/src/widgets/binding.dart:867:6: Context: Found this candidate, but the arguments don't match.

void runApp(Widget app) {

     ^^^^^^

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

#0      KernelSnapshot.build (package:flutter_tools/src/build_system/targets/dart.dart:231:7)

<asynchronous suspension>

#1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:526:25)

<asynchronous suspension>

#2      _BuildInstance.invokeTarget.<anonymous closure> (package:flutter_tools/src/build_system/build_system.dart:481:35)

#3      new Future.sync (dart:async/future.dart:222:31)

#4      AsyncMemoizer.runOnce (package:async/src/async_memoizer.dart:43:45)

#5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:481:21)

<asynchronous suspension>

<asynchronous suspension>

#6      BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:419:36)

<asynchronous suspension>

#7      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:154:50)

<asynchronous suspension>

#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:607:18)

<asynchronous suspension>

#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:507:33)

<asynchronous suspension>

#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)

<asynchronous suspension>

#11     _rootRun (dart:async/zone.dart:1124:13)

#12     _CustomZone.run (dart:async/zone.dart:1021:19)

#13     _runZoned (dart:async/zone.dart:1516:10)

#14     runZoned (dart:async/zone.dart:1463:12)

#15     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)

<asynchronous suspension>

#16     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:497:20)

#17     CommandRunner.runCommand (package:args/command_runner.dart:197:27)

<asynchronous suspension>

#18     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:416:21)

<asynchronous suspension>

#19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)

<asynchronous suspension>

#20     _rootRun (dart:async/zone.dart:1124:13)

#21     _CustomZone.run (dart:async/zone.dart:1021:19)

#22     _runZoned (dart:async/zone.dart:1516:10)

#23     runZoned (dart:async/zone.dart:1463:12)

#24     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)

<asynchronous suspension>

#25     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:367:19)

<asynchronous suspension>

#26     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)

#27     new Future.sync (dart:async/future.dart:222:31)

#28     CommandRunner.run (package:args/command_runner.dart:112:14)

#29     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:251:18)

#30     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)

<asynchronous suspension>

#31     _rootRun (dart:async/zone.dart:1124:13)

#32     _CustomZone.run (dart:async/zone.dart:1021:19)

#33     _runZoned (dart:async/zone.dart:1516:10)

#34     runZoned (dart:async/zone.dart:1500:12)

#35     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)

<asynchronous suspension>

#36     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)

<asynchronous suspension>

#37     _rootRun (dart:async/zone.dart:1124:13)

#38     _CustomZone.run (dart:async/zone.dart:1021:19)

#39     _runZoned (dart:async/zone.dart:1516:10)

#40     runZoned (dart:async/zone.dart:1463:12)

#41     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)

<asynchronous suspension>

#42     runInContext (package:flutter_tools/src/context_runner.dart:65:24)

<asynchronous suspension>

#43     run (package:flutter_tools/runner.dart:50:10)

#44     main (package:flutter_tools/executable.dart:65:9)

<asynchronous suspension>

#45     main (file:///usr/local/google/home/ianh/dev/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)

#46     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)

#47     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)



build failed.



FAILURE: Build failed with an exception.



* Where:

Script '/usr/local/google/home/ianh/dev/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 716



* What went wrong:

Execution failed for task ':app:compileFlutterBuildDebugArm64'.

> Process 'command '/usr/local/google/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 10s
Running Gradle task 'assembleDebug'...                             11.2s
Gradle task assembleDebug failed with exit code 1
@Hixie Hixie added c: regression It was better in the past than it is now c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. t: gradle "flutter build" and "flutter run" on Android a: first hour The first hour of using Flutter labels Nov 15, 2019
@Hixie Hixie added this to the Goals milestone Nov 15, 2019
@jonahwilliams
Copy link
Member

This isn't a tool crash, but the error message there shouldn't contain a stack trace

@jonahwilliams
Copy link
Member

I guess per the definition of crash in tags "stack traces logged to console" it is though XD

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: first hour The first hour of using Flutter c: crash Stack traces logged to the console c: regression It was better in the past than it is now t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants