Skip to content

How to specify if Intellij / Android Studio treats a project as Dart vs Flutter #5370

@MisterJimson

Description

@MisterJimson

Steps to Reproduce

  1. Open a Flutter or Dart project
  2. Right click on test file or folder, Run or Debug tests
  3. Observe output and see if the Flutter SDK is being used, or if the Dart SDK is being used
    3.1. Flutter SDK: flutter test ........
    3.2. Dart SDK: pub run test ........

If the wrong command is used for the project, running or debugging will fail. How do we configure the project so the IDE uses the correct tool?

Right click on test file, run, results in this:
image

Right click on test file, debug, results in this:
image

Running flutter test on the cli works fine, and the Flutter SDK path is correctly configured in the IDE.

Version info

/Users/jrai/dev/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.0.3, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-CA)
    • Flutter version 2.0.3 at /Users/jrai/dev/flutter
    • Framework revision 4d7946a68d (2 weeks ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/jrai/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/jrai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/jrai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
    • IntelliJ at /Users/jrai/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.55.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (3 available)
    • Pixel 2 (mobile) • FA8121A00353 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos        • darwin-x64     • Mac OS X 10.15.7 19H524 darwin-x64
    • Chrome (web)     • chrome       • web-javascript • Google Chrome 89.0.4389.90

• No issues found!
Process finished with exit code 0

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