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 erro
Removing modules.xml
file under the /.idea
folder solved my issue.
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
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.
As was already answered here the best solution is deleting all .iml files, but it could be done just Refreshing Gradle Project at Gradle tab> right click on your project > Refresh Gradle Project.
Then a Clean and Rebuild should be done also.
Edit:
The screenshot:
I think you can take the IDE automatic advice of deleting the xxx.iml files
Delete the *.iml files and rebuild the project (Build > Rebuild), it should be ok after that.