android - 颜色.xml : Error: Unsupported type 'component' (Android studio)

标签 android xml

创建新项目后,colors.xml 文件出现错误(更多详细信息:Error on first build after creating a project: XML document structures must start and end within the same entity)我“修复”了 colors.xml 文件,现在出现了这个新错误:

colors.xml: Error: Unsupported type 'component'

colors.xml 文件如下所示:

<application>
    <component name="PropertiesComponent">
        <property name="ATTACHED_TOOL_WINDOW.DEFAULT.NELE_EDITOR.COMPONENT_TREE.AUTO_HIDE" value="false" />
        <property name="ATTACHED_TOOL_WINDOW.DEFAULT"/>
    </component>
</application>

我没有在 android 项目中做任何事情,我只是创建了它,但第一个构建不起作用。非常感谢任何帮助。

最佳答案

颜色资源文件中没有Component标签。

这里是一个colors.xml的例子

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
</resources>

关于android - 颜色.xml : Error: Unsupported type 'component' (Android studio),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52892088/

相关文章:

android - 使用不同状态下的两个图像切换按钮

java - 工具栏小部件与 ScrollView 重叠

android - 以编程方式设置 AdMob id 字符串

python - Odoo 10 - Many2one 过滤 xml

javascript - xml 添加属性转义 &

java - 生成跳音克雷特频率的功能

android - 在 Android fragment 中使用 onBackPressed()

java - Android中如何实现后台任务

android - 我应该为支持所有语言的 TextView 使用哪种字体?

android - 自定义 XML 资源中的引用字符串资源