Flutter-intellij: IntelliJ opens example project without Flutter module

Created on 22 Nov 2016  Â·  10Comments  Â·  Source: flutter/flutter-intellij

When I open one of the flutter examples in IntelliJ (tested with hello_world, hello_service and gallery), the IDE loads the Dart module but no Flutter module.

In the _Modul Settings_ (_context menu on the root node in the project tree -> Open Module Settings_) Is one problem listed: "_Project hello_world: project SDK is not defined_". I did't find a way to activate the Flutter Module in the IDE.

  1. There should be a a way, to activate Flutter Support in the IDE
  2. The IDE should recognize, that the Flutter module needs to be loaded. Maybe update the Flutter plugin or add a _flutter.yaml_ file in the example projects.

Informations to reproduce the issue and a workaround to activate the Flutter support:

  1. Get the hello_world example:

https://github.com/flutter/flutter/tree/b9bff6a912c62c9dae5eddbaef80927655b769d7/examples/hello_world

  1. Open the example project in IntelliJ

  2. Click on "_Get dependencies_" in the "_'Pub get' has not been run_" message

  3. The following error appear:

Working dir: /Users/jonas/dart/hello_world
/Users/jonas/Library/flutter/bin/cache/dart-sdk/bin/pub get
Resolving dependencies...
The Flutter SDK is not available.
Depended on by:
- hello_services 
Process finished with exit code 69
  1. Close IntelliJ and create the file _flutter.yaml_ with this content:
name: hello_world
uses-material-design: true
  1. Restart IntelliJ with the hello_world example.

  2. The message "_'hello_world' is not a Flutter module, devide debugging is not fully supported._" appear.

  3. Click on _Change module type to Flutter and reload project_

  4. Run the pub action _Get dependencies_ (Should work fine without error).

Flutter doctor output:

$ flutter doctor

[✓] Flutter (on M.ac OS, channel master)

    • Flutter at /Users/jonas/Library/flutter

    • Framework revision a0c567f751 (5 hours ago), 2016-11-21 20:17:41

    • Engine revision cea5ed2b9b

    • Tools Dart version 1.21.0-dev.6.0



[✓] Android toolchain - develop for Android devices (Android SDK 25.0.0)

    • Android SDK at /Users/jonas/Library/Android/sdk

    • Platform android-25, build-tools 25.0.0

    • Java(TM) SE Runtime Environment (build 1.8.0_111-b14)



[✓] iOS toolchain - develop for iOS devices (Xcode 8.1)

    • XCode at /Applications/Xcode.app/Contents/Developer

    • Xcode 8.1, Build version 8B62



[✓] IntelliJ IDEA Community Edition (version 2016.2.5)

    • Dart plugin installed

    • Flutter plugin installed



[✓] Connected devices

    • SM N9005 • eb53b4f0 • android-arm • Android 5.0 (API 21)
bug topic-getting-started

Most helpful comment

@mit-mit, this is correct.

All 10 comments

  1. Open the example project in IntelliJ

@jsiedentop, just to make sure: are these the steps you use for this?

  1. Invoke File->Open... in IntelliJ
  2. Browse to the path flutter/examples/hello_world
  3. Click OK

@mit-mit, this is correct.

Thanks @jsiedentop. To confirm, it looks like you're using IntelliJ IDEA Community Edition (version 2016.2.5)? I'm guessing your Dart and Flutter plugins are up to date?

Yes, I'm using the IntelliJ IDEA Community Edition in Version 2016.2.5
Pugins Versions
Flutter: 0.1.5
Dart: 162.2485

@mit-mit offered in #471 a better workaround for opening the example projects with flutter support and without creating the flutter.yaml file manually:

  1. Close any open projects you have in IJ with hello_services in them
  2. Invoke File > New> Project... in IJ
  3. Click Next on the Flutter SDK page
  4. In the New Project screen, click the ... button next to Project location, and browse to the folder that has the hello_services project
  5. Click Finish
  6. Say yes when it asks if you want to override an existing .idea or .idl files

The last point 6. was not necessary, cause I wasn't ased.

We need to verify that we see a butter bar to make this project a flutter project (and we should commit the updated mete-data file).

Butterbar verified.

screen shot 2016-12-13 at 5 00 07 pm

And the action works.

However it appears to be updating files in the .idea subdir and I don't think we want to commit those.

screen shot 2016-12-13 at 5 13 29 pm

Will look a little more tomorrow. (Ideas welcome in the meantime, though!)

We've made a lot of progress on improving detection of projects that do not have Flutter modules but should. There still remain issues specific to the flow for hello_services which will involve some feature work.

(See #471.)

Moved to On-Deck. Next steps depend on creating and exploring the getting started user journey.

Closing in favor of #316 which addresses the issue of Flutter projects missing IDEA metadata.

Was this page helpful?
0 / 5 - 0 ratings