Android Studio 3.1: Erroneous unresolved references in editor
Solution 1:
- Exit Studio.
- Delete .idea/ (seems to me that's most important), build/, app/build directories.
- Start Studio
- Set Settings -> Build -> Gradle settings back (last stable Gradle local distribution in my case).
- Clean&rebuild project.
Helps me.
Solution 2:
Delete {projectDir}/.idea/libraries
, then go to File -> Sync Project with Gradle Files.