Flutter-intellij: Opening an existing Flutter project that is missing .iml/.idea files causes confusing errors

Created on 18 Oct 2016  Â·  17Comments  Â·  Source: flutter/flutter-intellij

We should implement ProjectOpenProcessor for easy opening existing Flutter projects (I mean those that have never been opened in the IDE before and do not have .idea folder, so that Flutter module is created for them, not the default module type).

enhancement topic-getting-started

All 17 comments

+1, as discussed in #326 this causes a confusing Android message ("Frameworks detected: Android framework is detected in the project Configure"), and causes the debug config to be missing.

From #421: This also means that the user is left with an empty IDE shell rather than with a shows Project View and the code editor open on main.dart.

As per the conversation in #530, I think the plan is to document this short-coming and potentially fix this up a bit in a future release.

We should create a project with the cli, then try and File > Open that project (to determine how common this use case is for the user).

As per our discussion last week, short-term is to update the known issues doc.

Long-term work to be driven by a getting started user journey.

cc @mit-mit

I confirmed that in 0.1.8 RC this issue only pertains to projects that are missing the .iml file and/or .idea directory.

A new project -- whether created with flutter create or IntelliJ has both these, and opens as expected.

Thanks! As mentioned in #607, we've really got to double-down on this flow as it may be hard to ensure that even our sample projects have reliably sufficient metadata.

As per #621, the OpenProcessor should also do it's best to make sure that pub is run if needed.

It's looking like the ProjectOpenProcessor could be a silver bullet for several different issues...

Can we update our known issues (https://github.com/flutter/flutter-intellij#known-issues) to close this out?

I'm trying to run this example: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager/example but when i open the folder in android studio I get all kinds of errors about various things not being configured. I copied the flutter/dart settings from another project, but I'm still getting this message.

cc @stevemessick

I got it working, but it reasons that it's possible to use the same config when opening flutter projects not created from the IDE.

@goleary : do you recall what you had to do?

sorry for the slow response. I had to open settings and update flutter sdk location in the language settings to match the path of my other IDE created projects.
image
I believe I also had to enable dart for the project:
image

Super. That helps. Thanks for following up!

I seem to be getting results similar to this issue in very recent versions of AS and the Flutter plugin.

On my system on a freshly cloned project, the .iml are not generated, the Project Structure option might simply disappear for no reason and code completion won't work on Java and Kotlin files when loaded from the root of the project (it kind of works when the android/ folder is loaded).

This is compared to a freshly created Flutter project, on where everything works fine.

I have noticed that modules config are different and tried to manually recreate them, which fixes the issues, except that it only remakes the .iml files (which are not checked into version control).

Android Studio version is 3.6.2, Flutter plugin version is 45.0.1 and this is the output of flutter doctor -v (note that I'm limited to an older flutter version due to work):

[✓] Flutter (Channel unknown, v1.12.13+hotfix.7, on Linux, locale en_US.utf8)
    • Flutter version 1.12.13+hotfix.7 at /home/mateusrc/flutter
    • Framework revision 9f5ff2306b (10 weeks ago), 2020-01-26 22:38:26 -0800
    • Engine revision a67792536c
    • Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/mateusrc/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/mateusrc/Android/Sdk
    • Java binary at: /home/mateusrc/Android/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /home/mateusrc/Android/android-studio
    • Flutter plugin version 45.0.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] IntelliJ IDEA Community Edition (version 2019.3)
    • IntelliJ at /home/mateusrc/idea-IC-192.5728.98
    • Flutter plugin version 44.0.3
    • Dart plugin version 193.6911.25

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

Edit: I created #4464 for this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KevinTheGray picture KevinTheGray  Â·  3Comments

willlarche picture willlarche  Â·  3Comments

dark-chocolate picture dark-chocolate  Â·  4Comments

matejthetree picture matejthetree  Â·  4Comments

sethladd picture sethladd  Â·  4Comments