Android Studio (Intellij) keeps adding second line to modules.xml

In my file, the ~/project/.idea/modules.xml

eighth line is always repeated. If I remove it, the string is returned on every save (auto save).

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/GoogleMapsForWork/GoogleMapsForWork.iml" filepath="$PROJECT_DIR$/GoogleMapsForWork/GoogleMapsForWork.iml" />
      <module fileurl="file://$PROJECT_DIR$/SAMRecipeApplication/SAMRecipeApplication.iml" filepath="$PROJECT_DIR$/SAMRecipeApplication/SAMRecipeApplication.iml" />
      <module fileurl="file://$PROJECT_DIR$/SAMStore/SAMStore.iml" filepath="$PROJECT_DIR$/SAMStore/SAMStore.iml" />
      <module fileurl="file://$PROJECT_DIR$/SillyAppStore.iml" filepath="$PROJECT_DIR$/SillyAppStore.iml" />
      <module fileurl="file://$PROJECT_DIR$/SillyAppStore.iml" filepath="$PROJECT_DIR$/SillyAppStore.iml" />
      <module fileurl="file://$PROJECT_DIR$/SillyAppStore/SillyAppStore-SillyAppStore.iml" filepath="$PROJECT_DIR$/SillyAppStore/SillyAppStore-SillyAppStore.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/apptentive/apptentive.iml" filepath="$PROJECT_DIR$/apptentive/apptentive.iml" />
      <module fileurl="file://$PROJECT_DIR$/volley/volley.iml" filepath="$PROJECT_DIR$/volley/volley.iml" />
    </modules>
  </component>
</project>

      

I understand that there is somewhere out there somewhere that insists on doubling this line (or it gets generated in two places), but I don't understand that the IDE incessions track this error well enough. None of my co-workers have this problem; here everyone swims.

This problem was puzzling, but it didn't stop me from working. This causes version control issues as this file is ALWAYS marked as modified (does not allow me to just type in text git add -A

).

Any suggestions other than wiping the project and a new one?

+3


source to share


2 answers


This seems to work for me:

  • Close Android Studio
  • Modify modules.xml with a text editor, remove duplicate entries module

  • Fix
  • Reopen Android Studio


AS should not modify this file. Also, it shouldn't show warnings like "project is already loaded".

+3


source


This often happens when you first open a project, and the solution is pretty straightforward and easy. Just remove the original line and the duplicated line, then wait a few minutes for Android Studio to generate it again, after re-creating it, it will never be duplicated later.

In your situation, remove those two duplicate lines and then wait a few minutes to create again.



<module fileurl="file://$PROJECT_DIR$/SillyAppStore.iml" filepath="$PROJECT_DIR$/SillyAppStore.iml" />
<module fileurl="file://$PROJECT_DIR$/SillyAppStore.iml" filepath="$PROJECT_DIR$/SillyAppStore.iml" />

      

0


source







All Articles