Skip to content

flutter run lib/foo.dart always runs the first thing built #11400

@gspencergoog

Description

@gspencergoog

Steps to Reproduce

  1. Create a sample using flutter create
  2. Rename lib/main.dart to lib/blue.dart
  3. Copy lib/blue.dart to lib/red.dart
  4. Edit lib/red.dart so that the theme color is red.
  5. Execute flutter run lib/blue.dart
  6. Notice that the theme is blue.
  7. Execute flutter run lib/red.dart
  8. Notice that the theme is still blue.
  9. Execute flutter build clean
  10. Execute flutter run lib/red.dart
  11. Notice that the theme is now red.

Basically, once you build an app, no amount of changing the arguments will let you run a different program until you do "flutter build clean" (or remove the build/ directory).

Logs

Launching lib/red.dart on Pixel in debug mode...
Initializing gradle...                                0.6s
Resolving dependencies...                             0.9s
Running 'gradlew assembleDebug'...                    3.2s
Built build/app/outputs/apk/app-debug.apk (21.2MB).
Installing build/app/outputs/apk/app.apk...           7.2s
Syncing files to device Pixel...                      2.9s

🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on Pixel is available at: http://127.0.0.1:8112/
For a more detailed help message, press "h". To quit, press "q".

Application finished.
Analyzing /Users/gspencer/code/run_bug/lib/red.dart...
No issues found!
Ran in 3.9s

Flutter Doctor

[✓] Flutter (on Mac OS X 10.12.6 16G29, locale en-US, channel master)
• Flutter at /Users/gspencer/code/flutter
• Framework revision 41d5ad411d (4 minutes ago), 2017-07-25 15:59:41 -0700
• Engine revision 3a12bc0
• Tools Dart version 1.25.0-dev.7.0

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.3)
• Android SDK at /Users/gspencer/Library/Android/sdk
• Platform android-25, build-tools 25.0.3
• ANDROID_HOME = /Users/gspencer/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.3.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 8.3.3, Build version 8E3004b
• ios-deploy 1.9.1
• CocoaPods version 1.2.1

[✓] Android Studio (version 2.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2)
• Flutter plugin version 15.2
• Dart plugin version 172.3317.48

[✓] Connected devices
• Pixel • FA6AS0303682 • android-arm • Android 7.1.2 (API 25)

Metadata

Metadata

Assignees

Labels

t: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions