So I ran into a strange problem today. I was having some issues with one of my modules in IntelliJ so I decided I should try blowing it out and rebuilding it from a fresh checko
This was resolved by going to GRADLE Tab on the project and removing other modules that needs to be reimported.
I had the same problem with a Gradle module. For me the fix was simply to delete this entry from the .idea/workspace.xml
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$/Locations">
<activation />
</task>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="locations" type="f1a62948:ProjectNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="locations" type="f1a62948:ProjectNode" />
<item name="Run Configurations" type="7b0102dc:RunConfigurationsNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
If you are using a maven structure, it could be that you ignore the poms after unloading modules. Check this at:
File | Settings | Build, Execution, Deployment | Build Tools | Maven | Ignored Files
Uncheck your modules and try again.
(If you have many files listed there, just deselect all via Ctrl + A, Space)