Dustin
Dustin

Reputation: 89

Eclipse hangs when trying to add menu.xml

I've recently starting developing with the android sdk. Currently, I am trying to add code to use a menu, however, when I try to add a menu.xml under res/menu, Eclipse hangs and freezes every time. When I reopen the Eclipse, menu.xml is there, but every time I try to open it, Eclipse hangs and freezes again. I am running on OS X Snow Leopard, Eclipse 3.6.2 and the latest android sdk and adt plugin.

Any help, insight, thoughts?? I am thoroughly stuck.

Thanks.

Dustin

Upvotes: 1

Views: 1691

Answers (4)

Lenny Porter
Lenny Porter

Reputation: 15

Same problem happens for me even under the latest version of Eclipse (Helios). If I wait long enough, Eclipse reports a stack overflow exception and then this shows up in the Output window:

W/ResourceType( 5124): Bad XML block: header size 0 or total size 9949440 is larger than data size 0

menu.xml:1: error: Error parsing XML: no element found

This indicates that the XML parser isn't handling empty documents and the Android menu editor is barfing on the newly created file while trying to open it. I'm sure there is some "standard" way of creating a new menu that doesn't break the IDE but I have no idea what that method is. I'm too used to editing my files by hand but this crash/hang bug is a serious nuisance.

Upvotes: 1

Dustin
Dustin

Reputation: 89

Thanks for the input guys. What ended up working for me was instead of trying to manually create a new menu.xml file, I find the add android .xml wizard and using it instead allowed me to add whatever I needed with out any hang ups.

Upvotes: 1

kjleftin
kjleftin

Reputation: 753

I ran into the same issue with the same setup. Right clicking menu.xml, selecting 'Open With', and selecting Xml Editor seemed to be a viable workaround for me.

Upvotes: 0

Jared
Jared

Reputation: 3176

Dustin,

I think what has happened is, your settings have become corrupt. I highly recommend resetting all your settings. Keep in mind, you will have to re-import all your projects so this can be quite a pain, but I really think this will fix your problem.

To start, find your workspace folder and rename it to something like "workspace-bad" Then, create an empty workspace folder to replace the one you just renamed. Lastly, open eclipse and it will act just like a brand-new installation.

You will need to re-import your projects, which can be done by going to eclipse, hitting File>Import... Then select under General "Existing Projects into Workspace" then hit "Next" and then hit "Browse" to find the root directory also make sure "Copy project into workspace" is checked

I also recommend doing your "problem project" first, that way you don't waste your time doing the rest and then find out you have to re-create it.

I'm hoping that fixes it for you, good luck! :-)

-Jared

Upvotes: 0

Related Questions