In my case, I solved the problem by deleting the .idea folder, then I closed Android Studio and reopened it.