.iml file does not exist - Android Studio
Asked Answered
C

7

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.

Chico answered 30/1, 2016 at 15:10 Comment(5)
Please see this question, it might help you https://mcmap.net/q/82068/-can-you-regenerate-a-deleted-modules-iml-file-in-android-studio/794088Lagting
I did not delete those files. They can not be loaded from my repository.Chico
Well, I got it solved. After cloning the project, just reopen it. If you have cloned project to D:\Android folder, in Studio, File>Open and open that project, it works. have no idea why and how.Chico
this answer helped me https://mcmap.net/q/82068/-can-you-regenerate-a-deleted-modules-iml-file-in-android-studioMisspell
This solution worked for me . https://mcmap.net/q/279200/-error-loading-project-in-android-studio-cannot-load-modulesNils
T
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.

Tidal answered 18/1, 2018 at 6:55 Comment(0)
P
38

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.

Parasite answered 18/7, 2019 at 12:52 Comment(5)
This is a really helpful and the quick solution worked for me as well.Unfaithful
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.oCockatoo
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.oDyslogistic
This one work for me on IntelliJ as well, Thank you!Jordanjordana
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.Bertold
P
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.

Psychosocial answered 24/11, 2020 at 6:42 Comment(0)
N
0

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

include ':app'
Nuclear answered 29/8, 2018 at 17:51 Comment(0)
B
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.

Benzine answered 5/8, 2019 at 15:42 Comment(0)
D
0

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

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

Durfee answered 23/8, 2021 at 3:47 Comment(0)
A
0

Go to Settings > Build, Execution, Deployment > Gradle > check generate *.iml files for modules imported from gradle. After change settings, resync project, iml files will be generated.

enter image description here

Armour answered 16/12, 2023 at 7:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.