我刚做了一个新项目。这是一个干净的项目,但是运行它时出现错误。我从我的 ic_launcher_background.xml 中收到了此错误,“ Android资源编译失败 C:\ Users \ Acer \ AndroidStudioProjects \ eStall \ app \ src \ main \ res \ drawable \ ic_launcher_background.xml:144:错误:格式不正确(无效的令牌)。“
当我查看ic_launcher_background.xml代码时,发现此错误, “属性缺少Android名称空间前缀” 。修复了在显示此Android资源编译失败错误之前,colors.xml中的错误。
是因为将3.3版(我认为)更新到3.4版吗?
ic_launcher_background.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayouts">
<shared>
<config>
<device id="pixel_xl" />
</config>
</shared>
</component>
<component name="AndroidLogFilters">
<option
name="TOOL_WINDOW_CONFIGURED_FILTER"
value="Show only selected application" />
</component>
<component name="ChangeListManager">
<list
name="Default Changelist"
comment=""
default="true"
id="a49e748a-44a5-45ea-b600-8c3086397541" />
<option
name="EXCLUDED_CONVERTED_TO_IGNORED"
value="true" />
<option
name="SHOW_DIALOG"
value="false" />
<option
name="HIGHLIGHT_CONFLICTS"
value="true" />
<option
name="HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value="false" />
<option
name="LAST_RESOLUTION"
value="IGNORE" />
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<projects_view />
</state>
</system>
</component>
<component name="FUSProjectUsageTrigger">
<session id="1505037262">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry
key="project.closed"
value="4" />
<entry
key="project.open.time.15"
value="1" />
<entry
key="project.open.time.18"
value="1" />
<entry
key="project.open.time.20"
value="1" />
<entry
key="project.open.time.25"
value="1" />
<entry
key="project.open.time.26"
value="1" />
<entry
key="project.open.time.6"
value="1" />
<entry
key="project.opened"
value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry
key="gradle"
value="2" />
<entry
key="java"
value="1" />
<entry
key="xml"
value="3" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry
key="Groovy"
value="2" />
<entry
key="JAVA"
value="1" />
<entry
key="XML"
value="3" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry
key="gradle"
value="1" />
<entry
key="txt"
value="19" />
<entry
key="xml"
value="295" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry
key="Groovy"
value="1" />
<entry
key="PLAIN_TEXT"
value="19" />
<entry
key="XML"
value="295" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file
current-in-tab="true"
pinned="false">
<entry file="file://$PROJECT_DIR$/app/src/main/res/layout/activity_main.xml">
<provider
editor-type-id="text-editor"
selected="true">
<state relative-caret-position="1020">
<caret
line="60"
selection-end-line="60"
selection-start-line="60" />
</state>
</provider>
<provider editor-type-id="android-designer2" />
</entry>
</file>
</leaf>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/app/build.gradle" />
<option value="$PROJECT_DIR$/app/src/main/res/layout/activity_main.xml" />
</list>
</option>
</component>
<component
name="ProjectFrameBounds"
extendedState="6">
<option
name="x"
value="858" />
<option
name="y"
value="-13" />
<option
name="width"
value="980" />
<option
name="height"
value="1040" />
</component>
<component name="ProjectView">
<navigator
proportions=""
version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="AndroidView">
<subPane>
<expand>
<path>
<item
name="eStall"
type="1abcf292:AndroidViewProjectNode" />
<item
name="Gradle Scripts"
type="ae0cef3a:AndroidBuildScriptsGroupNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="ProjectPane" />
<pane id="PackagesPane" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property
name="android.sdk.path"
value="$USER_HOME$/AppData/Local/Android/Sdk" />
<property
name="device.picker.selection"
value="Android_Accelerated_x86_Oreo" />
<property
name="settings.editor.selected.configurable"
value="AndroidSdkUpdater" />
</component>
<component name="RecentsManager">
<key name="android.template.packageName">
<recent name="com.example.estall" />
</key>
<key name="android.template.parentActivityClass">
<recent name="" />
</key>
</component>