1

After forking a Flutter package from GitHub, and try to edit it, then when I click "Open Android module in Android Studio" it opens /example/android instead of /android folder! enter image description here

Q: How to open /android folder of a package for editing?

Edit: steps I did

Step 1 Step 1

Step 2 Step 2

Step 3 Step 3

3 Answers 3

1

It would open both example/android/ & android/ folders. Look carefully in the project pane.

I created a new Flutter Plugin Project and did Open Android module in Android Studio. Here is how it looks: app/ is from example/android/ & test_plugin/ is from android/.

enter image description here

Sign up to request clarification or add additional context in comments.

6 Comments

Unfortunately, always I click "Open Android module in Android Studio " it opens only one Android studio project with example/android/ folder.
Could you add a screenshot of project pane? It opens both for me. It is actually the one that should be opened. It opens the example with the plugin code as dependency
I have edited my question by adding Screenshots, please take a look
I was already on this page, but this can't solve the problem, alright thank you, I think I should reinstall Android Studio because it lagging sometimes, and the problem probably comes from it.
|
0

Just ran into this issue myself (again).

As pointed out by @TirthPatel (see comments), there is a Flutter suggested way of opening the project via Android Studio, see here, i.e.

Which file do I open?

Via Welcome Screen or File > Open, select the build.gradle file located in /path-to-plugin/example/android/gradle.build

No libraries/modules shown except app

This is a precautionary set of steps, one that I haven't resolved to a single action to address the problem.

You may find .idea folders, and .dart-tool.

  • .idea contains IDE specific configurations, etc (see this or this for some more info, though not specific for Android Studio)
  • .dart-tool contains dart related configurations and pre-build files (via build-runner, locales via i18n, etc. (see here or here for more info)

Note: these can be/are generated

I deleted .idea and .dart-tool folders in

  • /path-to-plugin/
  • /path-to-plugin/android
  • /path-to-plugin/example
  • /path-to-plugin/example/android

Comments

0

This worked for me:

  1. Right click the .iml file in Android directory, and
  2. in the right click menu select flutter->Open for editing in Android Studio.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.