29

I'm trying to clone a project from BitBucket to my Android Studio. Finally it ends up with the error .iml file does not exist. What am I doing wrong?

enter image description here

Edit:- Once project is loaded from my repo, it says Error loading project. Two modules can not be loaded, those two modules are .iml files.

Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
Sumukha Aithal K
  • 675
  • 1
  • 10
  • 23

6 Answers6

43

It happened to me when I open my app from Android Studio's "Open Recent" option after cloning from my repository. Just close the app and re-open from "Open" option. It worked for me.

Khaled Saifullah
  • 2,279
  • 3
  • 25
  • 26
37

I faced similar problem, It just solved for by following steps - 1. Close you IntelliJ 2. Go to your codebase directory 3. delete the .idea folder 4. Start the Intellij again.

atul sachan
  • 597
  • 5
  • 10
  • This is a really helpful and the quick solution worked for me as well. – sanjeev kumar Sep 14 '20 at 12:07
  • Worked for me too, using Android Studio 4.1.1 Build #AI-201.8743.12.41.6953283, built on November 4, 2020 Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o – lubrum Nov 27 '20 at 18:36
  • Feb 2021 - This also worked for me. If it helps anyone I'm working in Flutter with with AS Android Studio 4.0 Build #AI-193.6911.18.40.6514223, built on May 20, 2020 Runtime version: 1.8.0_242-release-1644-b3-6222593 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o – its_broke_again Feb 02 '21 at 05:07
  • This one work for me on IntelliJ as well, Thank you! – Juan Enrique Riquelme Feb 12 '21 at 01:01
  • Don't forget to save your current .idea folder first, since deleting it and regenerating it will remove all of you local configuration such as custom linting scoops, run configuration, code style etc. Then add the missing files and/or replace the newly regenerated workspace.xml. – Joel Broström Feb 22 '22 at 09:11
6

I have solved this issue in android studio by following steps -

 1. Close Android Studio 
 2. Go to my app codebase directory
 3. Delete the .idea folder
 4. Start the Android studio again.

It's working like wow.

Faisal Ahmed
  • 816
  • 9
  • 12
0

i figured out that i was not having settings.gradle in my github content

include ':app'
Deepu
  • 598
  • 6
  • 12
0

In my case, it didn't work to download my repository again, I had to update Android Studio from 3.3 to 3.4.

I don't know if it's an isolated case or if someone else can solve this problem in the same way.

Gerrard
  • 819
  • 9
  • 7
0

In .idea folder delete modules.xml and restart Android Studio.

This will resolve the error by regenerating and linking the files again.

srt111
  • 1,079
  • 11
  • 20