简体   繁体   English

打开Eclipse Android Layout Editor时出错

[英]Error while opening the Eclipse Android Layout Editor

Since yesterday everytime I open my layout Editor in Eclipse for the Android UI I get the following exception: 从昨天起我每次在Eclipse中为Android UI打开布局编辑器时都会遇到以下异常:

Unhandled event loop exception 未处理的事件循环异常

    java.lang.StackOverflowError
    at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source)
    at 
    com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.isTheme(Unknown Source)
    at... 

the last part goes on and on as expected if an Stackoverflow Exception occurs. 如果发生Stackoverflow异常,最后一部分会按预期继续运行。

Anybody else experiencing this and found a solution? 有没有其他人经历过这个并找到了解决方案? I'm working with the latests android sdk on Mac OS X with Eclipse 3.5.2 我正在使用Eclipse 3.5.2在Mac OS X上使用最新的android sdk

I just installed the Carbon Version of eclipse and I get this error even in this fresh copy of eclipse. 我刚安装了eclipse的Carbon版本,即使在这个全新的eclipse副本中我也遇到了这个错误。

Very strange that I'm the only one experiencing this error. 非常奇怪,我是唯一遇到此错误的人。 Maybe it is not an Eclipse problem but an problem of my project setup... 也许这不是Eclipse问题,而是我的项目设置问题......

The same thing happened to me, and I had to dig a lot before I found a solution. 同样的事情发生在我身上,在找到解决方案之前我不得不挖掘很多东西。 In my styles.xml I had an entry where the name and parent attributes were identical: 在我的styles.xml中,我有一个名称和父属性相同的条目:

<style name="MyHeader" parent="MyHeader">
    <item name="android:background">@drawable/header_background</item>
</style>

By removing the parent attribute the layout editor finally worked again: 通过删除父属性,布局编辑器最终再次工作:

<style name="MyHeader">
    <item name="android:background">@drawable/header_background</item>
</style>

I have not had that particular error, but I have had various project corruption problems related to resources. 我没有那个特别的错误,但我遇到了与资源相关的各种项目损坏问题。 Sometimes cleaning the project and rebuilding fixes it. 有时清理项目和重建修复它。 Sometimes I have had to revert some project files in subversion. 有时我不得不在subversion中恢复一些项目文件。 Sometimes just relaunching eclipse fixes things. 有时只是重新启动eclipse修复了一些事情。 There is also a Fix Project Properties item in the Android Tools of the context menu that has helped once or twice. 上下文菜单的Android工具中还有一个Fix Project Properties项,它已经帮助过一次或两次。

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

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