Android Studio创建项目使用垃圾字符生成colors.xml [英] Android Studio create project generate colors.xml with junk characters

查看:576
本文介绍了Android Studio创建项目使用垃圾字符生成colors.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,我的Android Studio在创建新项目时始终会生成带有垃圾字符的colors.xml文件.我搜寻了互联网,但没有找到答案.有谁知道为什么会这样吗?

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?

我正在使用最近更新的Android Studio 3.2.1.但是,该问题已在以前的版本中发生.起初,我以为这是一个编码问题,但是我的设置已经为所有文件指定了UTF-8.另外,在其他文本编辑器中打开相同的文件也会显示相同的结果.

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.

当然,我可以编辑正确的内容并将其替换为colors.xml文件.但是,我担心如果我离开他们,这个问题将来会升级.

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:

推荐答案

让我发布答案以供将来参考.通过卸载Android Studio并清除所有设置解决了该问题.重新安装Android Studio后,问题已得到纠正.

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.

在Windows 10上,我在卸载时选择了清除用户设置".备份文件夹后,我还删除了"C:\ Users [user] \"中的 .AndroidStudio .AndroidStudio3.2 文件夹.之后,我重新安装Android Studio并重做所有设置.现在,我的Android Studio可以毫无问题地创建一个新项目.

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.

这篇关于Android Studio创建项目使用垃圾字符生成colors.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆