Android:默认 XML 编辑器不再打开 [不支持的内容类型错误]
我使用 Eclipse 在 Android 中开发应用程序已经有一段时间了。我最近将Android SDK平台更新到3.0,API 11。现在,我无法通过双击打开 AndroidManifest.xml 或 Layout 文件夹中的任何其他 XML 文件。
当我双击任何 XML 文件(如 main.xml / strings.xml)时,我收到“不支持的内容类型”错误。 http://www.freeimagehosting.net/uploads/67e93ddb8a.png
有什么办法解决这个问题?
PS:如果我使用“打开方式 -> 文本编辑器”打开 xml 文件,它会打开,但我无法看到 main.xml 的布局以及 strings.xml 和 androidmanifest.xml 各自的 GUI http://www.freeimagehosting.net/uploads/f537965b68.png
I've been using Eclipse for developing apps in android for quite some time. I updated the Android SDK Platform to 3.0, API 11 recently. Now I'm unable to open the AndroidManifest.xml or any other XML files in the Layout folder by double clicking.
When I double click any XML file (like main.xml / strings.xml), I get the "Unsupported Content Type" error.
http://www.freeimagehosting.net/uploads/67e93ddb8a.png
Is there any way to solve this problem?
P.S: If I open the xml files with "Open With -> Text Editor", it is opening, but I'm unable to see the layout for main.xml and respective GUI for strings.xml and androidmanifest.xml
http://www.freeimagehosting.net/uploads/f537965b68.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
如果您已经安装了
ArgoEclipse UMLEditor
,请将其卸载。我也遇到了这个问题。
UMLEditor 中有一个错误,
如果您是 Tigris.org 的成员,有人会就此问题提交 Bug
If you have installed
ArgoEclipse UMLEditor
, Uninstall it.I had this issue too.
There is a bug in UMLEditor,
Someone file a Bug on this issue, if you are a member at Tigris.org
目前一个不方便的解决方法是:
抱歉,如果您有 100 个 XML 文件! :-(
An inconvenient fix at the moment is to:
Sorry if you have 100's of XML files! :-(
我遇到了同样的问题,安装 Android ADT 插件后无法打开 Eclipse 插件开发 .xml 文件。它坚持对所有 .xml 文件使用 Android 通用 XML 编辑器,即使是那些与 Android 开发无关的文件。
要在另一个编辑器中打开 .xml 文件,我右键单击 .xml 文件并选择“打开方式...”,然后选择“插件清单编辑器”,这就是本例中我想要的。
I had the same problem that I could not open Eclipse Plug-in development .xml files after I had installed the Android ADT plugin. It insisted on using the Android Common XML Editor for all .xml files, even those not relating to Android development.
To open the .xml file in another editor I right click on the .xml file and choose 'Open With...' and select "Plug-in Manifest Editor" which is what I wanted in this case.
您现在可以尝试重命名 AndroidManifest.xml 来解决问题
另外,我建议您在 Google 代码中订阅此问题了解 Android 团队如何解决这些问题。
You can try just to get out of the problem for now renaming the AndroidManifest.xml and
also, i suggest you should subscribe to this issue in google code to know about how the Android Team is going with these problem.
您是否安装了其他任何可能改变 Eclipse 认为这些文件内容的内容,即从 XML 更改为其他内容?右键单击文件并打开其属性对话框;资源页面将指示它被认为是什么类型的文件。 XML 编辑器期望它是内容类型首选项页面中树的文本/XML 部分下的类型之一。
Have you installed anything else that might have changed what Eclipse thinks the content of those files is, i.e. from XML to something else? Right-click on a file and bring up its Properties dialog; the Resource page will indicate what Type of file it's considered to be. The XML Editor expects it to be one of the types under the Text/XML part of the tree in the Content Types preference page.
就在昨天我也遇到了同样的问题。我查遍了很多网站都没有答案。然后,我想起我的 Eclipse 上安装了许多 XML 编辑器作为插件。我想到了 Google Apps Engine、Tomcat...然后我说:也许是因为那些插件。因此,我在子目录中解压了一个新的 eclipse,下载了 ADT,一切正常。
I have faced the same problem just yesterday. I looked around many sites with no answer. Then, I remebered that I have many XML editors that are installed on my Eclipse as a plugins. I think of Google Apps Engine, Tomcat ... Then I sais : maybe it's because of those plugins. So, I unzipped a new eclipse in a subdir, I download the ADT and everything just worked fine.
我已经解决了这个问题,以下步骤对我有用 -
打开窗口>首选项>一般>内容类型
选择“文本”
在“文件关联”下
选择*.xml
点击右侧的删除按钮,然后点击底部的确定
I have solved this problem, following steps worked for me -
Open Window > Preferences > General > Content Types
Select "Text"
Under "File associations"
Select *.xml
Click remove button on right side and then ok in bottom
我正在使用一些使用
*.xml.templ
文件进行配置的软件(这首先是对 XML 的烦人使用),然后将它们复制到*.xml
实际使用的文件。我尝试在“首选项”>“常规”>“内容类型”>“文本”>XML 中添加扩展名*.xml.templ
,认为将使用类似 Bash 的文件名补全。这似乎被忽略了——无论我关闭并重新打开编辑器/透视图/Eclipse 本身多少次,它总是抱怨不支持的内容类型,然后在 XML 编辑器中打开文件而不进行任何突出显示。相反,我必须添加
*.templ
。显然扩展不能包含句点?I'm using some software that uses
*.xml.templ
files for configuration (which is an annoying use of XML in the first place), then copies them to*.xml
files for its actual use. I tried adding the extension*.xml.templ
in Preferences>General>Content Types>Text>XML, thinking that Bash-like filename completion would be used. This seemed to be ignored--no matter how many times I closed and reopended the editor/the perspective/Eclipse itself, it always complained about an unsupported content-type and then opened the file in the XML editor without any highlighting.Instead, I had to add
*.templ
instead. Apparently extensions can't include periods?