I had the exact same error and it was so annoying to see the alert every time I stared Android Studio. I tried the solution mentioned above including invalidating cache, restart etc, nothing made it go away.
In my case, we had a module that was deleted from source and the reference also removed from settings.gradle
. Turns out, .idea/modules.xml
was still referencing that module.
All I needed to do was remove that line from <modules>
in .idea/modules.xml
and it made it all go away.