When I Checkout a project form Google Cloud, Android Studio sais: "2 modules cannot be loaded. You can remove them from the project" and I cannot see the project. The error is in the iml files app.iml and ProjectName.iml.
Thanks!
When I Checkout a project form Google Cloud, Android Studio sais: "2 modules cannot be loaded. You can remove them from the project" and I cannot see the project. The error is in the iml files app.iml and ProjectName.iml.
Thanks!
Delete the *.iml files and rebuild the project (Build > Rebuild), it should be ok after that.
The best way to get rid of this problem is below:
1- close the project
2- close Android Studio IDE
3- delete the .idea directory
4- delete all .iml files
5- open Android Studio IDE and import the project again
Removing modules.xml file under the /.idea folder solved my issue.
I think you can take the IDE automatic advice of deleting the xxx.iml files
I had this issue in Android Studio 3.4 when I loaded an old project. I found some XML files in the .idea folder, including the file .idea/modules.xml.
It contained multiple <module fileurl="..."> tags, some of these were duplicates of existing modules but these had incorrect paths, in the fileurl attribute. I closed the project, deleted these duplicate tags, and reopened the project. This resolved the error for me.
For my Flutter project, it was not enough to delete the .idea directory in the project root, I had to delete also .idea folder in android directory.
1- close the project
2- close Android Studio IDE
3- delete the .idea directory, but also android/.idea directory!
4- delete all .iml files
5- open Android Studio IDE and reopen project
That's it, happy coding.