本文介绍了有效的 XML 文件给出“解析失败".Android ADT 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了一个 XML 文件:

I have made a XML file:

<?xml version="1.0" encoding="utf-8"?>
<selector
    xmlns:android="http://schemas.android.com/apk/res/android">
  <item
    android:state_pressed="true"
   android:drawable="@drawable/calender_h" />
  <item
   android:state_pressed="false"
  android:drawable="@drawable/calender_n" />
</selector>

但它给了我以下错误:

解析文件 G:eclipseHeliosWorkspaceWineCountryesdrawablecalendar_selector.xml 失败

可能是什么问题?

推荐答案

我不确定是不是一样,但是在库项目中更新到 ADT 15 时,我也遇到了类似的问题.这是目前仍然打开的谷歌问题:21046.

I'm not sure it's the same, butSimilar issue happened to me when updating to ADT 15, in a library project.this is the google issue that currently still opened: 21046.

这对我有用:

  1. 删除项目的库声明.
  2. 在图形布局中打开导致错误的布局(使用选择器的布局).
  3. 清理项目(项目 -> 清理)
  4. 关闭并重新打开 Eclipse.(现在布局应该没问题了)
  5. 您可以再次将项目设置为库.

希望这会有所帮助!(如果它仍然相关......)

Hope this helps!(if it's still relevant...)

这篇关于有效的 XML 文件给出“解析失败".Android ADT 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 20:36