简体   繁体   English

带有ADT插件的Eclipse-布局编辑器不显示内容(卡在“加载编辑器”上)

[英]Eclipse with ADT plugin - layout editor doesn't show content (stuck on “Loading editor”)

I'm facing a very strange issue on Eclipse with Android ADT plugin. 我在使用Android ADT插件的Eclipse上面临一个非常奇怪的问题。

When I try to open an XML layout file, the result is the one in the screenshot. 当我尝试打开XML布局文件时,结果就是屏幕截图中的一个。 The Layout editor doesn't show the file name and no content is loaded. 布局编辑器不显示文件名,并且不加载任何内容。 The editor stuck on "Loading editor" and if I switch to view, the XML is loaded fine. 编辑器停留在“加载编辑器”上,如果我切换到视图,则XML加载正常。

This issue is raising up with every layout file and with every project I open. 每个布局文件和我打开的每个项目都会引发此问题。 I tried to: 我试过了:

  • restart Eclipse 重新启动Eclipse
  • update the ADT plugin 更新ADT插件
  • install all the packages and updates from the Android SDK Manager 从Android SDK Manager安装所有软件包和更新

no errors are shown in the console. 控制台中未显示任何错误。

screenshot1

UPDATE UPDATE

Now Eclipse is showing a pop-up error "An error has occurred. See error log for more details.java.lang.NullPointerException" when I try to open any Layout XML file. 现在,当我尝试打开任何Layout XML文件时,Eclipse会显示一个弹出错误“发生了一个错误。有关更多详细信息,请参见错误日志。java.lang.NullPointerException”。

Solution 1 解决方案1

At the right side of the image you attached click the android logo with 19 a drop down list will open select some different version... 在您附加的图像的右侧,单击带有19的android徽标,下拉列表将打开,选择其他版本...

selecting 20 works for me 为我选择20件作品

Solution 2 解决方案2

right click layout file in the Package Explorer view and click 在Package Explorer视图中右键单击布局文件,然后单击

Open With -> Android Layout Editor 打开方式-> Android布局编辑器

  • Right-click on your project and close all unrelated projects. 右键单击您的项目,然后关闭所有不相关的项目。 Keep only one project opened at any one time. 一次只能打开一个项目。

  • Close all your perspectives and then open only a Java perspective. 关闭所有透视图,然后仅打开Java透视图。

  • Ensure that there is indeed a UCApplicationTheme that it has access to, otherwise change it to a different theme. 确保确实存在它可以访问的UCApplicationTheme,否则将其更改为其他主题。

  • Restart Eclipse. 重新启动Eclipse。 Then restart your computer. 然后重新启动计算机。

  • Then try opening a default layout from a newly generated blank Android project. 然后尝试从新生成的空白Android项目中打开默认布局。 Do not open the layout of a web view, even if you normally develop on Phone Gap/Cordova. 即使您通常在Phone Gap / Cordova上进行开发,也不要打开Web视图的布局。 Let's eliminate the web view as a possible problem. 让我们消除Web视图的可能问题。

  • When all else fails, reinstall Eclipse, the SDK, and ADT, completely from scratch. 当所有其他方法均失败时,请完全从头开始重新安装Eclipse,SDK和ADT。

And if you do get a NullPointerException, please be specific. 如果确实收到NullPointerException,请具体说明。 Cut and paste on here the exact error it's giving you. 在此处粘贴并粘贴给您的确切错误。

The Problem is you did update only android development tools from developer tool.. so you need to update the whole packages which are provided by the eclipse market.. Go to help-->install new software-->add the Repository-->and select all check boxes which are available in the developer tool... 问题是您确实只从开发人员工具中更新了android开发工具。因此,您需要更新Eclipse市场提供的整个软件包。去帮助->安装新软件->添加存储库->并选中开发人员工具中可用的所有复选框...

Its works for me.. 它对我有用。

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

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