Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: Open android module in Android Studio is disabled

I am trying to open my flutter project separately in android studio with "Open android module in Android Studio" but when I left click on my flutter project window to open it this is disabled for me while "Open iOS module in Xcode" is there. Please let me know I can I enable it and can open my flutter project for android in another module.

like image 683
Ammy Kang Avatar asked Jan 25 '19 11:01

Ammy Kang


People also ask

Can I open Flutter project in Android Studio?

Step 1: Open the Android Studio and select Tools from the menu bar and click on SDK Manager. Step 2: In the newly open window click on the plugins and in the search bar search for Flutter and Dart and then install it. Step 4: Now after installing Flutter and Dart we are ready to import a Flutter project.


2 Answers

>>> Only applies for Idea Intellij IDE

Okay, I finally figured out why the option is not available (greyed out).

It should be the inconsistency problem between the old version of the flutter plugin and a new one.

You might experience this issue if you created the project with a relatively old version flutter engine, and open it with a new version flutter plugin.

To know what happens and how to resolve it:

The old project contains a file: android.iml

which is not the same as in a latest created project: $projectname_android.iml

So you know how to fix the issue:

Rename the iml file to (YourProjectName_android.iml) That would instantly make the menu highlight again!

like image 195
RockingDice Avatar answered Sep 20 '22 12:09

RockingDice


Because you lost the xxx_android.iml file in android directory, it cannot be recognized as an android project.

So you only need to copy a xxx_android.iml file from other projects to the android directory.

Note, replace xxx with your project name

like image 38
heqingbao Avatar answered Sep 21 '22 12:09

heqingbao