Error while opening the Eclipse Android Layout Editor

爱⌒轻易说出口 提交于 2019-12-18 19:06:42

问题


Since yesterday everytime I open my layout Editor in Eclipse for the Android UI I get the following exception:

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.

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

I just installed the Carbon Version of eclipse and I get this error even in this fresh copy of 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...


回答1:


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:

<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>



回答2:


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. Sometimes just relaunching eclipse fixes things. There is also a Fix Project Properties item in the Android Tools of the context menu that has helped once or twice.



来源:https://stackoverflow.com/questions/2771517/error-while-opening-the-eclipse-android-layout-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!