有效的XML文件给出"无法解析"在Android的ADT错误 [英] Valid XML file gives "failed to parse" error in Android ADT

查看:157
本文介绍了有效的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>

但它给我以下错误:

but it is giving me the following error:

解析失败文件G:\ eclipseHeliosWorkspace \ WineCountry \水库\绘制\ calendar_selector.xml

Failed to parse file G:\eclipseHeliosWorkspace\WineCountry\res\drawable\calendar_selector.xml

这可能是什么问题?

推荐答案

我不知道它是相同的,但 更新到ADT 15时,在库项目类似的问题发生在我身上。 这是谷歌的问题,目前仍在开:<一href="http://$c$c.google.com/p/android/issues/detail?id=21046&q=tag%20requires%20a%20%27drawable%27%20attribute%20or%20child%20tag%20defining%20a%20drawable&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars"相对=nofollow> 21046 。

I'm not sure it's the same, but Similar 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. 关闭并重新打开蚀。 (布局现在应该是确定)
  5. 您可以重新设置该项目作为库。<​​/ li>
  1. Remove the library declaration of the project.
  2. Open the layout causing the error (the one which using the selector) in graphical layout.
  3. Clean the project (Project -> Clean)
  4. Close and reopen eclipse. (the layout should be ok now)
  5. You can set the project as library again.

希望这有助于! (如果它仍然适用?)

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

这篇关于有效的XML文件给出&QUOT;无法解析&QUOT;在Android的ADT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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