I am working on a projects since 3 months. Today most of my activities and xml files got corrupted. I have tried deleting workspace.iml file but it remains same.Local History in
Erasing the cache of the Android studio will resolve the problem, for that you have to go to:
C:\Users\user\.AndroidStudio3.5\system\caches
(On windows)
and on Mac:
~/.AndroidStudio3.5/system/caches
Delete all the files there and restart the Android studio.
Close android studio then delete the cache found in
C:\Users\**user**\.AndroidStudio3.6\system\caches
Important not to modify a file before having deleted the android studio cache
If you modify a file you risk not being able to recover your old code
I also had the same problem this morning. I thought this was due to migrating to AndroidX but It was wrong. It may occur due to improper indexing and building for e.g. the indexing is force stopped. or due to some IDE issues.
The isuue resolved by deleting gradle and .idea folder in project and clearing cache of Android Studio IDE by D:\Users\ABCD.AndroidStudio3.2\system\caches. And issue was resolved.
Note:- Please take Project Backups Daily.
Rename your project folder and delete .gradle and .idea file inside project folder
I am also facing the same issue so i am copy the files from Project location which is corrupted. In my case, there is list of files corrupted due to module added in Login Activity
Steps to solve the problem
Above one process is working for me.
I solved that by
Close project you are working on
//This enables deleting all cache files Close android studio
navigate to .AndroidStudio folder and then sytem then cache
delete the cache
Go to your project folder delete delete gradle and .idea folder
delete app.iml file too
import project dont open as exixting.
Boom you done.