Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio - Cannot load settings from file app.iml, file does not exist?

I faced this when importing projects from online git repos directly using Android studio, turns out the iml file in .idea modules.xml reference, were not being generated.

like image 774
Nishant Singh Avatar asked Jan 21 '20 12:01

Nishant Singh


People also ask

Can not load settings from file Android Studio?

It probably means your project workspace settings file is corrupted by whatever reason and Android Studio could not read it. Mine is probably because of BSOD, because Windows. To solve the error, just delete the workspace. xml as specified in the error message.

Where is the app IML file in Android Studio?

iml file in the project root, plus one . iml file in each module directory (e.g., app/ ). You might try Tools > Android > Sync Project with Gradle Files. Otherwise, you may need to re-import the project.

How do I run a .IML file?

However, if you want to open an IML file, you can open it using any text or source code editor, such as Notepad++ (Windows), Microsoft Visual Studio Code (cross-platform), or GitHub Atom (cross-platform).

Can I delete IML file?

In case you delete a module IML file, you can regenerate the file by rebuilding your project, reimporting your project, or opening and closing IDE. IML file is referenced and generated within IDEs. To open or edit . iml files, you need appropriate software.


1 Answers

Goto project root:

  • Delete any .iml files in the whole repo.
  • Make sure android studio is closed, and enter ".idea" folder.
  • Delete the "modules.xml" file (where the missing files are being referenced).
  • Open your project in Android studio, and it will now generate the missing .iml files, as-well as the modules.xml file.
  • You will no longer get the annoying popup!

Hope it helps.

like image 176
Nishant Singh Avatar answered Nov 07 '22 01:11

Nishant Singh