I am using Android Studio 2.0 Preview 4. I\'m using Android SDK tools 25 rc1. This error persists no matter how many times I clean / rebuild project. File->Invalidate Caches
I'm also getting the same problem after Migrating my existing project to AndroidX and i solve it by doing below things
Build -> Clean Project Build -> Rebuild Project
After that
File -> Invalidate Caches/Restart...