Android found tag ... where the item is expected

I am working on a project that has its own XML file in the res / values ​​map.

This is not deep XML:

<resources> <accesspoint ... 

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

Now I was looking a bit for this problem, and there are similar problems everywhere. But there is no solution. When I change them all to an element and give them a name and type, I still get an error message on the closing tags, which simply say: "Take care of yourself here."

I have no ideas, does anyone know what that means? And how can I fix it?

+8
android
source share
7 answers

In Eclipse, something is a bit sluggish. I had the same problem as you, regardless of what I renamed to a tag.

Solution: delete the tag and overwrite it manually (DO NOT COPY / Paste).

There must be some strange hidden character that somehow gets there because it just rewrites EXACTLY the same thing, and now I have no mistakes.

+14
source share

Right-click the xml file in the package explorer, then select Source β†’ Format.

+7
source share

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

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

+1
source share

Running the xml source file through xmllint is a good way to pick up other invisible special characters. In particular, pay attention to non-splitting space (& nbsp; / & # 160; / & # xa0;), which can cause critical errors if they occur where ADK tools expect spaces.

0
source share

open the xml file with MadEdit or any other Hex File editors, find "C2 A0" and replace everything with normal space.

Or just on the command line

$ sed -i 's / \ xc2 \ xa0 // g' / the / path / to / the / xml / file

0
source share

There can be many reasons. These problems are likely due to simple errors.

It can be

  • Invalid characters in string value. Remove unsupported characters and check.
  • When we find cop / paste from some other places, there may be hidden / imperceptible invalid characters, so check them and delete them.

Tip: Instead of copying / pasting, enter yourself.

0
source share

Sometimes Eclipse goes crazy.

Paste your code into Notepad, and then copy it from Notepad and paste it into Eclipse.

-one
source share

All Articles