is Android Studio corrupting my project files?

≯℡__Kan透↙ 提交于 2020-05-27 02:57:27

问题


I have two very annoying bugs which is ocurring in the project I am working with. Android Studio keeps overwritting code from many classes using another classes inside the same project.

1 - File contents are wrong
2 - The encoding inside some files seems to have strange characters

For you to have an idea, I will upload a few screenshots below:

This one was supposed to be an enumeration class.

This class was duplicated in another class (overwritting)

This class is all messed up and has strange characters...

At first, I thought the files were really corrupted, then I opened them in their respective folders to check whether it was only in Android Studio or not, and they are completely normal there.

ActivitiesMode.java

ReviewDatesRecyclerView (duplicated file)

ReviewEditRecyclerViewAdapter (UTF Strange characters)

Does someone has an idea on what can be happening?


回答1:


Should delete:

1) C:\Users\cc.AndroidStudio3.2\system\caches

2) all .iml files in your project folder

3) .idea with .gradle folders.




回答2:


I managed to solve all these problems by completely reinstalling Android Studio 3.3 and deleting all the configurations and related folders.

At first, I've reinstalled the IDE, but the same problem occured. Then I tried to follow instructions about encoding on this answer "Android Studio : unmappable character for encoding UTF-8"

None of these had any effect.

Here's how I fixed it:

  • Uninstalled Android Studio
  • Deleted Android Studio SDK
  • Deleted .gradle, .android, .AndroidStudio3.3 folders located in C:\Users\MyUserName
  • Fresh Installed Android Studio 3.3
  • Opened it's encoding settings on File > Settings > File Encodings
  • Changed all encoding types to UTF-8 (Global, Project and Default)



来源:https://stackoverflow.com/questions/54910115/is-android-studio-corrupting-my-project-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!