Android Studio : Open Android Module in Android Studio option is missing in flutter project
Asked Answered
V

3

5

I am developing a flutter app for both iOS and Android. When generating the APK, I prefer to use Android studio (my default IDE is VSCODE). However, when I go to Tools > Flutter I do not see Open Android Module in Android Studio option. I do see Open iOS Module in Xcode.

I followed couple of SO answers, even tried replacing android.iml file from a working project. Nothing happened. I re-cloned my project from BitBucket because sometimes the Android Studio was fine when the project is freshly from repo, but this time, that didn't work either.

I Also tried opening the gradle file and looking for the option (as explained in one SO answer), that didn't work too.

However I noticed, few issues.

  1. In the folder structure, the root folder is replaced by the flutter icon. in projects where I have no issues with, the folder icon is folder.
  2. In here I see .dart_tool folder. In working apps with no issue, I do not see this folder.
  3. I do not have an android.iml file. In other projects I did.

Below is my folder structure in a nutshell. Whats going on here and how to fix this issue?

enter image description here

Vernissage answered 27/7, 2020 at 11:40 Comment(0)
H
4

Simplest solution

  1. Open flutter project
  2. Go to android folder
  3. open manfiest file
  4. On the top right you will see option open module in android studio
  5. click on this option

Solution 2:- Import your android project as a project in android studio

Horseflesh answered 27/7, 2020 at 11:45 Comment(2)
in Android Studio 4.0.1 there is no “Flutter commands” banner at the top of the editor with a link labeled Open for Editing in Android StudioChenab
gradlew is missing (when Studio kicks in the gradle build automatically)Dianetics
N
4

When you don't see any options to

open module in android studio

because of missing .iml files caused by .gitignore file, follow simple steps.

  1. Click on File and choose Open..
  2. Now in the opened dialog choose android folder of example flutter project under your plugin module. For e.g if test is your plugin with example as it's app then you need to select and click Ok

test\example\android

Reference image of 3. Then wait for Android Studio to sync and download necessary jar files.

Nymphalid answered 12/7, 2021 at 19:6 Comment(0)
S
2

The easiest way is to use this command in the root directory of your project, it will create some missing files and it will definitely work.

flutter create --platforms=android .

Now just right click to Android folder

enter image description here

Superphysical answered 11/6, 2022 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.