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
I also had this problem with an SBT module. You can remove the offending module by going to the SBT tool window, right clicking on the module and selecting "Detach external project".
If this is a Gradle module, please check the .idea project folder there is a gradle.xml
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$/xxx" />
<option name="gradleHome" value="/opt/gradle/gradle-2.13" />
......
</GradleProjectSettings>
you should remove this entry and try to reimport your module
I am using Intellij Idea 2016.1.3, Mac OSX El Capitan 10.11.5
1.delete the file .idea/modules/your module.iml 2.edit the file .idea/gradle.xml del about your module like this:
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$/../fs-jycloud-monitor" />
<option name="gradleHome" value="$USER_HOME$/gradle/gradle-2.14.1" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/../fs-jycloud-monitor" />
</set>
</option>
</GradleProjectSettings>
A cleaner solution would probably be to first try File -> Invalidate Caches / Restart....
Click on your Gradle tab, right-click on your project, click on 'Reload Gradle Project'
Ah ha! I think I found the answer.
In my .idea project folder there is a misc.xml. In this file I found
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/../Projects/.../module/pom.xml />
</set>
</option>
I removed that and also cleaned up some duplicate entries from other areas that pertained to my module and I was able to import again.
IntelliJ is pacified for at least another day!