0

For reasons unfathomable to me, sometimes I edit an xml file (such as res\layout\main.xml) and Eclipse stops recognizing it. I get errors like "Bad XML block: header size 93 or total size 0 is larger than data size 0".

If I delete the contents and retype the xml file everything works fine.

Any ideas what's going on?

lynvie
  • 1,028
  • 1
  • 14
  • 25
  • 1
    Have an eye over [**THIS**](http://stackoverflow.com/questions/8706704/android-app-development-error-bad-xml-block-header-size-60-or-total-size-3932) – edwin Jan 18 '13 at 04:23
  • Yes, I saw this post -- I tried the relevant suggestions. But the only thing that fixed the problem was to erase and re-type the xml file. – lynvie Jan 18 '13 at 04:26

2 Answers2

1

See this problems usually comes because of menu -

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:id="@+id/save_tea" android:title="@string/save_tea_label" />
</menu>

Better if you are not using menu so remove it otherwise give the proper string information there.

Thanks

Ravi
  • 2,277
  • 3
  • 22
  • 37
  • If I have a menu error, I get the following: _Error: No resource found that matches the given name (at 'title' with value '@string/menu_settings')_ – lynvie Jan 18 '13 at 04:37
1

Try out both this things ,this can be help you to resolve the problem:

I just ran into the same error message. In my case, the XML was referencing a missing icon file in the drawables folder.

or

A Project->Clean should take care of this.

GOLDEE
  • 2,318
  • 3
  • 25
  • 49
  • Yes, I tried these things, but they didn't help. Only erasing/re-typing fixed the xml file. – lynvie Jan 18 '13 at 04:40
  • 1
    try validataing the file or refreshing – GOLDEE Jan 18 '13 at 04:42
  • Hmmm... Ok, I can try this next time I get the error. I tried to reproduce my error just now without success. That's been part of the problem -- it seems random when the xml/Eclipse problems happen. Will accept your answer if that works. – lynvie Jan 18 '13 at 04:47