flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 318 forks source link

Hide Build button for Flutter app or fail gracefully on click. #3677

Open feinstein opened 5 years ago

feinstein commented 5 years ago

Steps to Reproduce

I created a new Flutter project (this happens either if I create it in IntelliJ IDEA or in Android Studio) and selected to build it clicking here:

image

Then I get the following Error message:

image

Clicking OK opens this dialog:

image

The <No SDK> drop down menu have these options:

image

If I select one of the options and try to build again, I get another error:

image

Clicking OK opens the same dialog as before, and I think I am supposed to fill in something at the Project compiler output field:

image

What should I place there? Is this really necessary? Why isn't this being configured at project creation?

Version info

[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17763.557], locale pt-BR) • Flutter version 1.7.8+hotfix.3 at C:\Programacao\Flutter\sdk\flutter • Framework revision b712a172f9 (8 days ago), 2019-07-09 13:14:38 -0700 • Engine revision 54ad777fd2 • Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1) • Android SDK at C:\Programacao\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.1 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01) • All Android licenses accepted.

[√] Android Studio (version 3.4) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 37.0.1 • Dart plugin version 183.6270 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2018.2) • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.5 X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins

[√] IntelliJ IDEA Ultimate Edition (version 2019.1) • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.1 • Flutter plugin version 37.1.3 • Dart plugin version 191.7830

[√] VS Code (version 1.35.1) • VS Code at C:\Users\Michel Feinstein\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 2.25.1

[√] Connected device (1 available) • ONEPLUS A5000 • bc18175a • android-arm64 • Android 9 (API 28)

! Doctor found issues in 1 category. Process finished with exit code 0

kenzieschmoll commented 5 years ago

cc @stevemessick

stevemessick commented 5 years ago

The hammer icon is used to build Java and Gradle projects. It isn't used for Flutter. It isn't part of the Flutter plugin.

You don't need a separate build step for Flutter app development, until it is time to publish. For that, see the Deployment section of https://flutter.dev/docs.

feinstein commented 5 years ago

Hmm... Ok, I guess it's an habit to hit the "build" option when I make large modifications, just to see if everything is in place, since it's quicker than a "run".

So for Flutter if I want to check if everything is in place I should just look the Dart Analysis tab or hit Run to do a full compile + install?

stevemessick commented 5 years ago

IIRC most of the time needed to run a Flutter app is building the app. You do have to have a device to run with, though. It might be worth reviewing Flutter's build modes and testing. The Dart Analysis window will let you know if there are any compile-time issues. Also, I find the terminal emulator built into IntelliJ to be handy when I need to use the Flutter command-line tool.

feinstein commented 5 years ago

Well, shouldn't the IntelliJ plug-in create a project in such a way that clicking Build won't trigger a cryptic error? Or hide the build button altogether? At least have this documented on the IntelliJ installation page.