Error loading project in Android Studio: cannot load modules

前端 未结 6 1623
花落未央
花落未央 2020-12-08 12:55

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

相关标签:
6条回答
  • 2020-12-08 13:16

    Removing modules.xml file under the /.idea folder solved my issue.

    0 讨论(0)
  • 2020-12-08 13:19

    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

    0 讨论(0)
  • 2020-12-08 13:25

    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.

    0 讨论(0)
  • 2020-12-08 13:26

    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:

    0 讨论(0)
  • 2020-12-08 13:35

    I think you can take the IDE automatic advice of deleting the xxx.iml files

    0 讨论(0)
  • 2020-12-08 13:37

    Delete the *.iml files and rebuild the project (Build > Rebuild), it should be ok after that.

    0 讨论(0)
提交回复
热议问题