开发者

phantom error "error parsing XML: unbound prefix"

开发者 https://www.devze.com 2022-12-31 22:35 出处:网络
The error \"e开发者_StackOverflow中文版rror parsing XML: unbound prefix\" shows up on my main layout: main.xml when I first open Eclipse. To make the error go away, all Ihave to do is make a modificat

The error "e开发者_StackOverflow中文版rror parsing XML: unbound prefix" shows up on my main layout: main.xml when I first open Eclipse. To make the error go away, all I have to do is make a modification to the file, then undo it, then hit save (have to make a change in order to be able to save file and thus trigger the new syntax check).

My environment is:

Fedora Eclipse Platform
Version: 3.4.2
Based on build id:  20090211-1700

My target is Android API level 5.

The first time I saw the error I spent a long time trying to track down "the problem" but later realized there isn't really a problem, it's just a phantom error.

Screenshot: http://i50.tinypic.com/2i89iee.jpg

Who should I report this to?


This sounds like a bug with the ADT plugin for Eclipse. I'd first check if it's already filed; if not, go ahead and report it at b.android.com.


Once i build project with it and spent much time with this. It may also be included in the .java files (you have added by accident) line:

import android.R 

Now it thinks that we need this prefix:

xmlns:android="http://schemas.android.com/apk/res/android" 

Solve: Find and delete this line and re-build project:

// DELETE import android.R 

Add your package Resources import:

import com.johnsmith.example


I had the exact same problem and here is what I did.

  • First go down to the problems tab and select the unbound prefix error
  • Right click it and select delete.
  • It will give you a warning message just click OK and you should be good to go.

I wouldn't recommend using this for all problems just for the phantom errors that don't seem to be caused by anything.

Hope it helps


Change the flipper id to vflipper

because android xml doesn't support capitol letter for declaring values

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号