问题
Suddenly my Android Studio always generates the colors.xml file with junk characters when creating a new project. I have scoured the internet and found no answer. Does anyone have any idea as to why this is happening?
I'm using Android Studio 3.2.1 which I just updated recently. But, the problem already occurred in the previous version. At first, I thought that this is an encoding problem, but my settings already specify UTF-8 for all files. Also, opening the same file in other text editors display the same result.
Of course, I can just edit and replace the colors.xml file with the correct content. But, I fear this problem will escalate in the future if I leave them.
Here is a screenshot of the file in question:
Here is the screenshot of my setting:
回答1:
Let me post an answer for future reference. The problem was solved by uninstalling Android Studio and clearing all settings. After I reinstall Android Studio the problem was corrected.
On Windows 10, I chose "clear user settings" while uninstalling. I also deleted the .AndroidStudio and .AndroidStudio3.2 folders in "C:\Users[user]\" after I backup those folders. After that, I reinstall Android Studio and redo all the settings. Now my Android Studio can create a new project without a problem.
回答2:
Android Studio 3.2.1
I found a solution! Just delete user settings folder ..\Users\%USERNAME%\ .AndroidStudio3.2
来源:https://stackoverflow.com/questions/52909918/android-studio-create-project-generate-colors-xml-with-junk-characters