I got into this problem with intellij 2016.1 because I installed the generated sources in a directory that was not in the base directory of the project.
For example, in the Android factor in the "Generated Sources" section, I had:
Directory for generated files: <project dir>/target/intellij-gen
When I changed this to <project dir>/gen , the problem disappeared.
Similarly, when I changed it to <project dir>/gen2 , the problem also disappeared, but I had to do a deep cleanup to get it to compile again:
rm -rf ~/.IdeaIC2016.1/system/compile-server/<project>_<hash>
and deleting all generated directories and target dir.
rmin May 11 '16 at 15:01 2016-05-11 15:01
source share