Skip to content

Weirdness when running Flutter with any other entrypoint than lib/main.dart #16838

@filiph

Description

@filiph

Steps to Reproduce

  1. Create new Android Studio Flutter project
  2. Run it in simulator to check that it's fine.
  3. Create a duplicate of lib/main.dart. Let's call it lib/main_alternate.dart.
  4. Create a new Run/Debug configuration in IntelliJ
    screen shot 2018-04-20 at 18 48 50
  5. Run main_alternate.dart

You'll see that this confuses Flutter. I've had instances when this worked well, but other instances when main.dart was clearly running instead of main_alternate.dart. For example, breakpoints in main_alternate.dart weren't hit while breakpoints in main.dart were. Despite this, Flutter console said Launching lib/main_alternate.dart.

Flutter Doctor

Paste the output of running flutter doctor -v here.

$ flutter doctor -v
[✓] Flutter (Channel master, v0.3.3-pre.8, on Mac OS X 10.13.3 17D102, locale en-US)
    • Flutter version 0.3.3-pre.8 at /Users/filiph/dev/flutter
    • Framework revision 36cf1158ec (2 hours ago), 2018-04-20 17:39:32 -0700
    • Engine revision 232060828a
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.2)
    • Android SDK at /Users/filiph/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.2
    • 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-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.4.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 23.2.2
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 20.0.3
    • Dart plugin version 173.4127.31

[✓] VS Code (version 1.22.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.9.2

[✓] Connected devices (1 available)
    • iPhone X • 9072CF25-2137-4EB4-984F-EB3DC9A3F418 • ios • iOS 11.2 (simulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions