1

Android Studio is replacing files in my projects. It mainly affects layout files. Mostly it looks like this: enter image description here

Most of the time the app is still able to build and run without errors. I can easily restore these files through Git, but it's really annoying.

This doesn't appear for any reason, like a crash or something like that.

I'm running Android Studio 4.0.1 Build #AI-193.6911.18.40.6626763, built on June 25, 2020 Runtime version: 1.8.0_242-release-1644-b01 amd64

Has anyone encountered something similar and knows how to fix it?

BlazeCodeDev
  • 631
  • 1
  • 7
  • 27
  • 3
    It's a known bug in android studio nothing to fear about. You can follow these links https://stackoverflow.com/questions/53249677/android-studio-shows-wrong-file-contents?noredirect=1&lq=1 https://stackoverflow.com/questions/53403502/strange-error-in-colors-xml-file-in-android-studio https://stackoverflow.com/questions/52821567/android-studio-shows-some-mess-in-xml-files if your code is connected with repository then you can revert your code then this will also be fixed. – Umair Aug 04 '20 at 09:22
  • Thank you for the links, I thought I was the only one. Lets hope for a fix then. – BlazeCodeDev Aug 04 '20 at 09:40

3 Answers3

0

Erasing the cache of Android Studio will resolve the issue. to do this go to /.AndroidStudio4.0/system/caches/ folder and delete all the files in this folder.

0

i was facing that issue

copy your code and move it to other directory then Delete Top 2 folders named(.gradle and .idea) and also delete all .iml files then import this project (do not open project use import project)

a_local_nobody
  • 7,947
  • 5
  • 29
  • 51
Praveen Singh
  • 53
  • 1
  • 6
-1

you can solve this issue >> kindly reinstall android studio . several days before i got this issue .

Ajay Pawar
  • 35
  • 7