在Eclipse Android项目无法编辑的main.xml [英] Cannot edit main.xml in Eclipse Android project

查看:256
本文介绍了在Eclipse Android项目无法编辑的main.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的ADT在Eclipse几款Android应用程序,但现在我无法在新的或旧的Andr​​oid项目编辑RES /布局/ main.xml中。当我在main.xml中选项卡中键入,我的按键没有任何效果。同样,我无法在图形布局选项卡中的变化。我可以拖动窗口小部件在屏幕上,但是当我松开鼠标按钮的它不存在。我已经检查了main.xml中没有写保护,既通过Eclipse和文件系统。我能够创建在该目录中另一个文件,或者通过Eclipse或文件系统,这表明该目录没有写保护。我没有问题,编辑或者src目录下添加文件。

I've created several Android applications with the ADT in Eclipse, but I'm now unable to edit res/layout/main.xml in new or old Android projects. When I type in the main.xml tab, my keystrokes have no effect. Similarly, I am unable to make changes in the Graphical Layout tab. I can drag a widget onto the screen, but it does not remain when I let go of the mouse button. I have checked that main.xml is not write-protected, both through Eclipse and the file system. I am able to create another file in that directory, through either Eclipse or the file system, which shows that the directory is not write-protected. I have no problem editing or adding files under the "src" directory.

我运行Eclipse 3.6.1经典与Windows 7的FWIW Android开发工具的10.0.1.v201103111512-110841版本,我最近安装了其他一些谷歌工具(GWT和GAE)的插件,虽然我没有把它们用于任何Android的项目(明显)。

I am running Eclipse Classic 3.6.1 with version 10.0.1.v201103111512-110841 of the Android Development Tools on Windows 7. FWIW, I recently installed plugins for some other Google tools (GWT and GAE), although I did not use them for any of the Android projects (obviously).

更新:当我在不同的编辑器编辑XML,然后刷新它在Eclipse中,我得到的错误错误解析XML:绑定preFIX。我的文件是正确的,但我发现,标准的URLhttp://schemas.android.com/apk/res/android不可达。具体来说,服务器已关闭。我不知道这是否涉及到我原来的问题。

Update: When I edit the xml in a different editor and then refresh it in Eclipse, I get the error "Error parsing XML: unbound prefix". My file is correct, but I discovered that the standard URL "http://schemas.android.com/apk/res/android" is unreachable. Specifically, the server is down. I don't know if this is related to my original problem.

UPDATE2:这里是foo.xml,我创建了Eclipse之外,但显示错误的错误解析XML:绑定preFIX 第二行:

Update2: Here is foo.xml, which I created outside of Eclipse but is showing the error Error parsing XML: unbound prefix on the second line:

<?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:text="TextView" 
android:id="@+id/textView1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" />

该网站 schemas.android.com 仍下降。

我尝试运行我的程序,让编译器错误,但它建立正确和错误去从.xml文件了。进入数字。

I tried running my program to get the compiler errors, but it build correctly, and the error went away from the .xml file. Go figure.

这仍然留下不能够编辑的任何的的.xml在Eclipse文件的原始问题。当我试图编辑上面的XML文件,我在弹出得到这个错误:

That still leaves the original problem of not being able to edit any .xml file within Eclipse. When I tried to edit the above xml file, I got this error in a popup:

No grammar constraints (DTD or XML schema) detected for the document.

我的猜测是,这是由于 schemas.android.com 正在下降。

更新3(响应slund的评论):

清洗和重建没有任何改变。我可以建立,但我还是得到了没有语法约束的错误,当我试图编辑或者.xml文件。

Cleaning and rebuilding did not change anything. I could build, but I still got the "No grammar constraints" error when I tried editing either .xml file.

在XML文件的目录为 C:\\用户\\艾伦\\工作区\\ SqliteDemo \\水库\\布局,只是因为它应该是。它包含任何其他文件。问题视图显示没有警告或问题,这个项目(虽然有一些矿山的其他项目)。

The directory of the xml files is C:\Users\Ellen\workspace\SqliteDemo\res\layout, just as it should be. It contains no other files. The Problem view showed no warnings or problems for this project (although there were some for other projects of mine).

更新4

我也不能在Eclipse编辑(默认)AndroidManifest.xml中。

I also cannot edit the (default) AndroidManifest.xml from within Eclipse.

推荐答案

我刚刚碰到了这个问题。由于没有公认的答案在这里,我给它一个猜测。

I just recently ran into this problem. Since there is no accepted answer here, I'll give it a guess.

我相信这事做在XML中指定的版本。我不是你的情况完全肯定,但或许可以验证我的说法。是否这次月食主要版本匹配什么在XML文件中指定?

I believe that this has something to do with the version specified in the xml. I'm not entirely sure in your case, but, perhaps you can verify my claim. Does the eclipse major version match what is specified in your xml file?

例如,在Eclipse开普勒打开以下(4.3):

For instance, opening the following in Eclipse Kepler (4.3):

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
   id="com.someplace.something"
...

我无法编辑,以及。然而,在Eclipse靛蓝打开相同的plugin.xml(3.7)似乎让我编辑文件就好了。因此,Eclipse的主要版本必须匹配。

I was unable to edit it, as well. However, opening the same plugin.xml in Eclipse Indigo (3.7) seemed to allow me to edit the file just fine. So, the Eclipse major version must match.

我没有挖得太深了Eclipse文档中验证这一点。所以,在这一点上,我只是调用这个预感作为的根本原因。

I didn't dig too deep to verify this in the Eclipse documentation. So, at this point, I'm just calling this a hunch as to the root cause.

有关谁运行到这个问题,如果你真的坚持要编辑在Eclipse XML文件的人,那么你可能需要在XML中指定适当的主要版本。不幸的是,保持的Eclipse的旧版本周围是不是最理想的解决方案! ; - )

For anyone who runs into this issue, if you really insist upon editing the xml file in Eclipse, then you might require the proper major version specified in the xml. Unfortunately, keeping old versions of Eclipse around isn't the most ideal solution! ;-)

这篇关于在Eclipse Android项目无法编辑的main.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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