Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android found tag ... where item is expected

Tags:

android

I'm working on a project that has a custom XML file in the res/values map.

It's not a deep XML:

<resources>
    <accesspoint
    ...

Eclipse is generating an error: found tag accesspoint where item is expected

Now, I've googled this a bit and there are similar problems everywhere. But no solution. When I change them all to item and give them a name and a type, I still get an error on the closing tags that simply says "Orginally defind here".

I'm out of ideas here, does anyone know what this means? And how I fix it?

like image 439
Koen027 Avatar asked Dec 26 '11 19:12

Koen027


4 Answers

Something is a bit screwy in Eclipse. I had the same problem as you no matter what I renamed the tag.

Solution: delete the tag, and re-write it by hand (DON'T COPY/PASTE).

There must be some kind of strange hidden character that gets in there somehow, because just re-writing the EXACT same thing, and I now have no errors.

like image 94
Dave Avatar answered Oct 10 '22 19:10

Dave


Right click on the xml file in the package explorer, then Source -> Format.

like image 43
Somil Avatar answered Oct 10 '22 18:10

Somil


I know this is a 9 years old question. But I got the same error message today. My solution differs from the described answers. Changes in the - here - corresponding file accesspoints.xml were necessary. My corresponding content was:

<resources>
    <accesspoint name="btnOpen">false</accesspoint>
    ...
</resources>

This accesspoint tag is to be replaced by the item tag:

<resources>
    <item type="accesspoint" name="btnOpen">false</item>
    ...
</resources>
like image 21
gotwo Avatar answered Oct 10 '22 18:10

gotwo


Tried all of the above solutions. None of them worked. Found the problem in Eclipse:

Copy the xml file from res/values folder to res/xml folder.

like image 29
sersem1 Avatar answered Oct 10 '22 20:10

sersem1