After a random crash on Android Studio, a lot of my code is being opened by Android Studio as if it was an XML or R.class.
Explaning it better: It does correct itself after a fresh install of Android Studio (any version), and it hasn't happened in 3.1.4, but I'm using features from 3.2. After less than 6h coding, a random crash happens on Android, I report it by the AS and this suddenly happens to many of my files, not allowing me to build it again until I reinstall Android entirely.
I'm running AS as an Administrator, and I do have permission everywhere. My project is not corrupted nor are my files, since every single fresh install simply brings my code back and I can code until any/a random crash happens, creating this AS/Gradle corruption.
As you can tell, even when "corrupted" on AS, my code is actually fine when opened with any external editor, so reverting back my Git code is not enough to make me get rid of this problem (I wish).
Some important things I already tried:
- Clear Cache and Restart Android Studio
- Use Android 3.2.1 and 3.3 RC
- Rebuild Project
- Resync with Gradle, FileSystem, etc, etc...
- Clear caches from /user/.gradle/caches and from /user/.AndroidStudio3.3/system/caches
- Delete .idea and .gradle from the project's folder
- Reinstall Android Studio (also tried with both versions)
I found a related issue here, but the guy simply deleted both of those files. But that's something I can't do, since this is happening with my project files. This related issue can be found here.
I also found another 3 or 4 posts, which where never answered with a valid answer and that were "never solved" or were solved by installing a new version of AS. But I'm already trying the Beta and this error/problem persists....
Consider this post a cry for help. This is haunting me in my development in such a way that I simply can't program more than 6 hours before getting this bizarre behavior in each and any newer version of AS.
References:
Related by @CanProgram (since 2.3.3?)