<p dir="auto">Reproduction steps:</p>
<ol dir="auto">
<li><code class="notranslate">flutter create test</code></li>
<li>replace the <code class="notranslate">lib/main.dart</code> with:</li>
</ol>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'package:flutter/widgets.dart';

void main() =&gt; runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const Placeholderrr(); // Typo is intentional!
  }
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'package:flutter/widgets.dart'</span>;

<span class="pl-k">void</span> <span class="pl-en">main</span>() <span class="pl-k">=&gt;</span> <span class="pl-en">runApp</span>(<span class="pl-k">new</span> <span class="pl-c1">MyApp</span>());

<span class="pl-k">class</span> <span class="pl-c1">MyApp</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-k">const</span> <span class="pl-c1">Placeholderrr</span>(); <span class="pl-c">// Typo is intentional!</span>
  }
}</pre></div>
<ol start="3" dir="auto">
<li>compile it once with <code class="notranslate">flutter build apk --debug</code> and see an error message.</li>
<li>compile it again with the same command, and see it succeed (as below)</li>
</ol>
<p dir="auto">This will really help with fixing syntax errors while coding!  We just have to compile twice! 👍</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(home/gspencer:master) -- test &gt; flutter build apk --debug
Running &quot;flutter packages get&quot; in test_reload...             0.6s
Initializing gradle...                                       1.0s
Resolving dependencies...                                    1.0s
Running 'gradlew assembleDebug'...                               
compiler message: lib/main.dart:9:18: Error: Method not found: 'Placeholderrr'.
compiler message:     return const Placeholderrr();
compiler message:                  ^
Compiler failed on lib/main.dart

FAILURE: Build failed with an exception.

* Where:
Script '/usr/local/google/home/gspencer/code/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 450

* What went wrong:
Execution failed for task ':app:flutterBuildDebug'.
&gt; Process 'command '/usr/local/google/home/gspencer/code/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 6s
Gradle build failed: 1
(home/gspencer:master) -- test &gt; flutter build apk --debug
Initializing gradle...                                       1.0s
Resolving dependencies...                                    1.0s
Running 'gradlew assembleDebug'...                           8.5s
Built build/app/outputs/apk/debug/app-debug.apk.
"><pre class="notranslate"><code class="notranslate">(home/gspencer:master) -- test &gt; flutter build apk --debug
Running "flutter packages get" in test_reload...             0.6s
Initializing gradle...                                       1.0s
Resolving dependencies...                                    1.0s
Running 'gradlew assembleDebug'...                               
compiler message: lib/main.dart:9:18: Error: Method not found: 'Placeholderrr'.
compiler message:     return const Placeholderrr();
compiler message:                  ^
Compiler failed on lib/main.dart

FAILURE: Build failed with an exception.

* Where:
Script '/usr/local/google/home/gspencer/code/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 450

* What went wrong:
Execution failed for task ':app:flutterBuildDebug'.
&gt; Process 'command '/usr/local/google/home/gspencer/code/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 6s
Gradle build failed: 1
(home/gspencer:master) -- test &gt; flutter build apk --debug
Initializing gradle...                                       1.0s
Resolving dependencies...                                    1.0s
Running 'gradlew assembleDebug'...                           8.5s
Built build/app/outputs/apk/debug/app-debug.apk.

</code></pre></div>
<h2 dir="auto">Steps to Reproduce</h2>
<ol dir="auto">
<li>Modify <code class="notranslate">flutter/examples/hello_world/lib/main.dart</code> to add a line: <code class="notranslate">import foo.dart;</code></li>
<li>Add a <code class="notranslate">flutter/examples/hello_world/lib/foo.dart</code> file.  Add some garbage to it that won't compile (e.g. a single line containing <code class="notranslate">asdf</code>).</li>
<li>Invoke <code class="notranslate">flutter run</code>.  It reports a compilation error and fails, as expected:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get
graphics artifacts, consider enabling software rendering with
&quot;--enable-software-rendering&quot;.
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                           0.7s
Resolving dependencies...                                        1.3s
Gradle task 'assembleDebug'...                                  

Compiler message:
lib/foo.dart:1:1: Error: Variables must be declared using the keywords 'const',
'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
asdf
^^^^
lib/foo.dart:1:1: Error: Expected ';' after this.
asdf
^^^^
Compiler failed on
/home/jamesdlin/git/flutter/flutter/examples/hello_world/lib/main.dart
 6.3s
Gradle task assembleDebug failed with exit code 1"><pre class="notranslate"><code class="notranslate">$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get
graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                           0.7s
Resolving dependencies...                                        1.3s
Gradle task 'assembleDebug'...                                  

Compiler message:
lib/foo.dart:1:1: Error: Variables must be declared using the keywords 'const',
'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
asdf
^^^^
lib/foo.dart:1:1: Error: Expected ';' after this.
asdf
^^^^
Compiler failed on
/home/jamesdlin/git/flutter/flutter/examples/hello_world/lib/main.dart
 6.3s
Gradle task assembleDebug failed with exit code 1
</code></pre></div>
<ol start="4" dir="auto">
<li>Without modifying any files, invoke <code class="notranslate">flutter run</code> again.</li>
</ol>
<h2 dir="auto">Result</h2>
<p dir="auto">I expect to see the same failure as in step 3.  Instead <code class="notranslate">flutter run</code> syncs files to the emulator, runs the app, and doesn't show the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get
graphics artifacts, consider enabling software rendering with
&quot;--enable-software-rendering&quot;.
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                           0.7s
Resolving dependencies...                                        1.2s
Gradle task 'assembleDebug'...                                   8.4s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                      0.6s
D/        ( 4463): HostConnection::get() New Host Connection established
0xe9e08bc0, tid 4484
D/EGL_emulation( 4463): eglMakeCurrent: 0xebc2dae0: ver 2 0 (tinfo 0xe9e036d0)
Syncing files to device Android SDK built for x86...             1.0s

🔥  To hot reload changes while running, press &quot;r&quot;. To hot restart (and rebuild
state), press &quot;R&quot;.
An Observatory debugger and profiler on Android SDK built for x86 is available
at: http://127.0.0.1:38847/
For a more detailed help message, press &quot;h&quot;. To detach, press &quot;d&quot;; to quit,
press &quot;q&quot;."><pre class="notranslate"><code class="notranslate">$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get
graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                           0.7s
Resolving dependencies...                                        1.2s
Gradle task 'assembleDebug'...                                   8.4s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                      0.6s
D/        ( 4463): HostConnection::get() New Host Connection established
0xe9e08bc0, tid 4484
D/EGL_emulation( 4463): eglMakeCurrent: 0xebc2dae0: ver 2 0 (tinfo 0xe9e036d0)
Syncing files to device Android SDK built for x86...             1.0s

🔥  To hot reload changes while running, press "r". To hot restart (and rebuild
state), press "R".
An Observatory debugger and profiler on Android SDK built for x86 is available
at: http://127.0.0.1:38847/
For a more detailed help message, press "h". To detach, press "d"; to quit,
press "q".
</code></pre></div>
<p dir="auto">I see this behavior only with compilation errors in imported files; if I instead introduce compilation errors into <code class="notranslate">main.dart</code>, <code class="notranslate">flutter run</code> consistently fails.</p>
<h2 dir="auto">Doctor</h2>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (Channel master, v0.10.1-pre.43, on Linux, locale en_US.UTF-8)
    • Flutter version 0.10.1-pre.43 at /home/jamesdlin/git/flutter/flutter
    • Framework revision 4f4005ee65 (2 hours ago), 2018-10-15 12:18:13 -0700
    • Engine revision 50c2e69daf
    • Dart version 2.1.0-dev.7.0.flutter-b99bcfd309

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /home/jamesdlin/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 27.0.3
    • Java binary at: /home/jamesdlin/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] Android Studio (version 3.2)
    • Android Studio at /home/jamesdlin/android-studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.27.2)
    • VS Code at /usr/share/code
    • Flutter extension version 2.19.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API
      28) (emulator)

• No issues found!"><pre class="notranslate"><code class="notranslate">[✓] Flutter (Channel master, v0.10.1-pre.43, on Linux, locale en_US.UTF-8)
    • Flutter version 0.10.1-pre.43 at /home/jamesdlin/git/flutter/flutter
    • Framework revision 4f4005ee65 (2 hours ago), 2018-10-15 12:18:13 -0700
    • Engine revision 50c2e69daf
    • Dart version 2.1.0-dev.7.0.flutter-b99bcfd309

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /home/jamesdlin/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 27.0.3
    • Java binary at: /home/jamesdlin/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] Android Studio (version 3.2)
    • Android Studio at /home/jamesdlin/android-studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.27.2)
    • VS Code at /usr/share/code
    • Flutter extension version 2.19.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API
      28) (emulator)

• No issues found!
</code></pre></div>