Unfortunaetly my laptop shutdown unproperly during coding in Android Studio. When I turned on again and tried to reload the project one class / java file was corrupted and s
In my case there were 2 file 1 had XML code and other had java code. Delete the file that has XML code and rename your Java file the way it was. Solved my problem.
I once had this issue and the way i solved it was to delete the folder C:\Users\cc.AndroidStudio3.2\system\caches.
i hope this helps
To solve the problem I would cut all the files from the project, allowing android studio to update its indices showing no files in the project tree. Soon after I move them all back then let android studio to load the files again. After loading the cache would get updated with the correct information.