简体   繁体   English

Android:默认XML编辑器不再打开[不支持的内容类型错误]

[英]Android: Default XML Editor isn't opening anymore [Unsupported Content Type Error]

I've been using Eclipse for developing apps in android for quite some time. 我已经使用Eclipse在Android中开发应用程序已有一段时间了。 I updated the Android SDK Platform to 3.0, API 11 recently. 我最近将Android SDK平台更新到3.0,API 11。 Now I'm unable to open the AndroidManifest.xml or any other XML files in the Layout folder by double clicking. 现在我无法通过双击打开LayoutManifest.xml或Layout文件夹中的任何其他XML文件。

When I double click any XML file (like main.xml / strings.xml), I get the "Unsupported Content Type" error. 当我双击任何XML文件(如main.xml / strings.xml)时,我收到“不支持的内容类型”错误。 http://www.freeimagehosting.net/uploads/67e93ddb8a.png http://www.freeimagehosting.net/uploads/67e93ddb8a.png

Is there any way to solve this problem? 有什么方法可以解决这个问题吗?

PS: 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 PS:如果我打开带有“打开方式 - >文本编辑器”的xml文件,它会打开,但是我无法看到main.xml的布局以及strings.xml和androidmanifest.xml的相应GUI http:// www.freeimagehosting.net/uploads/f537965b68.png

If you have installed ArgoEclipse UMLEditor , Uninstall it. 如果您已安装ArgoEclipse UMLEditorArgoEclipse UMLEditor卸载。

Eclipse >> Help >> About Eclipse >> Installation Details >> select >> Unistall Eclipse >>帮助>>关于Eclipse >>安装细节>>选择>> Unistall

I had this issue too. 我也有这个问题。
There is a bug in UMLEditor, UMLEditor中有一个错误,
Someone file a Bug on this issue, if you are a member at Tigris.org 如果您是Tigris.org的会员,有人就此问题提交了Bug

AgroEclipse UMLEditor Bug

An inconvenient fix at the moment is to: 目前一个不方便的解决办法是:

rename the file then rename it back 重命名该文件,然后重命名

Sorry if you have 100's of XML files! 对不起,如果您有100个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. 在安装Android ADT插件后,我遇到了无法打开Eclipse Plug-in开发.xml文件的问题。 It insisted on using the Android Common XML Editor for all .xml files, even those not relating to Android development. 它坚持对所有.xml文件使用Android Common XML Editor,甚至是那些与Android开发无关的文件。

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. 要在另一个编辑器中打开.xml文件,我右键单击.xml文件并选择“打开方式...”并选择“插件清单编辑器”,这是我在这种情况下想要的。

你现在可以尝试解决问题,现在重命名AndroidManifest.xml,我建议你应该在谷歌代码中订阅这个问题 ,以了解Android团队如何应对这些问题。

我已经解决了这个问题,按照以下步骤操作 - 打开窗口>首选项>常规>内容类型选择“文本”在“文件关联”下选择* .xml单击右侧的删除按钮然后在底部确定

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. 我正在使用一些使用*.xml.templ文件进行配置的软件(这首先是令人烦恼的使用XML),然后将它们复制到*.xml文件以供其实际使用。 I tried adding the extension *.xml.templ in Preferences>General>Content Types>Text>XML, thinking that Bash-like filename completion would be used. 我尝试在首选项>常规>内容类型>文本> XML中添加扩展名*.xml.templ ,认为将使用类似Bash的文件名完成。 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. 这似乎被忽略了 - 无论我关闭多少次并重新打开编辑器/透视/ Eclipse本身,它总是抱怨不支持的内容类型,然后在XML编辑器中打开文件而没有任何突出显示。

Instead, I had to add *.templ instead. 相反,我不得不添加*.templ Apparently extensions can't include periods? 显然,扩展不能包括期间?

Have you installed anything else that might have changed what Eclipse thinks the content of those files is, ie from XML to something else? 您是否安装了其他可能已经改变Eclipse认为这些文件内容的内容,即从XML到其他内容? 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. XML编辑器希望它是“内容类型”首选项页面中树的“文本/ XML”部分下的类型之一。

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. 然后,我重申我有许多XML编辑器作为插件安装在我的Eclipse上。 I think of Google Apps Engine, Tomcat ... Then I sais : maybe it's because of those plugins. 我想起了Google Apps Engine,Tomcat ......然后我说:也许是因为那些插件。 So, I unzipped a new eclipse in a subdir, I download the ADT and everything just worked fine. 所以,我在一个子目录中解压缩了一个新的日食,我下载了ADT,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM