Android Studio-wont remember new edits and automatically reverts to old versions of files sometimes

后端 未结 6 1024
臣服心动
臣服心动 2021-01-17 14:37

Every once and a while I have an issue with the new Android Studio. Sometimes while editing, if I make a mistake in one of my files, then try to build it, Android studio wi

相关标签:
6条回答
  • 2021-01-17 15:17

    While this issue still occasionally happens (as of currently the latest version is 0.5.+), a simple workaround is to manually edit the xml file with a text editor, then save it. Android Studio will then force resync those files.

    0 讨论(0)
  • 2021-01-17 15:19

    I still have this issue, the only way I have found to fix it is to go to the terminal in android studio and run

    rm -R app/build/intermediates/data-binding-layout-out
    

    Android Studio is failing to delete the last build of the layout, when you try to compile again. Once you do it manually everything is back to normal.

    0 讨论(0)
  • 2021-01-17 15:23

    I have the same issue, but i followed following steps and it resolved my issue,

    1) Edit your layout file and open the same layout file in notepad, if you can see updated data in notepad then its Studio Synch issue. then re-synch project.

    2) If your edited layout file is not reflecting new changes in notepad file then, first re-synch Studio project and followed step 1.

    I hope this will resolved your issue as well.

    0 讨论(0)
  • 2021-01-17 15:26

    To save the latest edits, click on the particular file in project window and select synchronize, and rebuild the code. then the latest edits will be saved.

    0 讨论(0)
  • 2021-01-17 15:27

    I've had a similar issue when I make a mistake in my strings.xml file, for example when I have an apostrophe without preceding with a '\'. The trouble is that when the build fails, Android Studio automatically opens app\build\intermediates\res\merged\debug\values\values.xml to show me the broken string. If I then try to correct the string in that file, it doesn't do any good because when I try to rebuild, strings.xml is still broken. The crucial thing is to make sure that you're making the correction in strings.xml rather than the values.xml file.

    0 讨论(0)
  • 2021-01-17 15:27

    I just had the same error and made me go crazy I solved it by copying my project file to another directory and then importing it as a new project and the problem disappeared

    0 讨论(0)
提交回复
热议问题