1. Unbound prefix
I was getting an error in a layout file: error parsing xml, unbound prefix. It turned out that a line of xml pasted in from another (working) layout file contained the prefix ‘android1:’, whereas all other lines in this layout file were prefixed ‘android:’. The other layout file, which still worked fine, had all lines prefixed ‘android1:’. I don’t yet know why this happens.
2. ‘Your project contains errors’ – when it doesn’t
I have this problem in Eclipse (as described in the stackoverflow post copied below) and it is not yet resolved.
Getting this error frequently, even though there’s no actual error. I know this because after a reboot the project builds work fine – for a while! When constantly updating code and re-running on emulator (I have auto build set), the problem appears on average each 20-30 minutes, which is maybe every 10th re-run (a very rough average, it’s not regular). You can imagine how annoying it is. I’ve read many posts and have tried many things but have not found the solution. If anyone can help I’d very much appreciate it.
When I get the problem there’s a cross on the project name but nowhere else. Cleaning the project removes the cross but I get the same error message when I try to run/build it.
I’ve tried many suggestions found in stackoverflow and elsewhere:
- Project clean, as mentioned, doesn’t help, nor does Project clean followed by restarting Eclipse.
- Deleted & recreated debug certificate but it didn’t help.
- Checked Problems view: only has warnings.
- Tried Fix Project Properties then Project Clean.
- Checked window-preferences-android-sdklocation, which is correct.
- No recent imports or even new files – only code changes.
- Tested theory that it happens when an xml file is the active file in the editor – not true in my case.
- Another idea was to delete the bin folder, but it won’t let me (I don’t have the permission, which I normally do have – see below).
- Another suggestion I saw was to delete the jars from libs folder, but that didn’t help (so I restored it).
- Checked the software versions (even though same set-up has worked fine for months). It seems fine for target sdk 16.
- Software set-up has been the same for many months, with auto Windows & Java updates being the only changes I’m aware of, and everything has been working fine until a couple of weeks ago. I’m not aware of anything unusual happening around that time.
The key thing for me is permissions. When I get the problem, I see that the apk (from last successful run) is no longer owned by me (the only user of this laptop, administrator rights). The File Properties Security tab says ‘To continue you must be an administrative user with permission to view this object’s security properties’. When I press Continue I see ‘Unable to display current owner’. After the reboot (and after subsequent builds until the problem reappears) I see the list of users and their permissions.
Extra notes in case there’s a clue.
- 1) If I just ok the error message and try again to run the app, I get this message in the console: Failed to install abc.apk on device ‘xyz’: Local path doesn’t exist. If I then make a trivial change to some code and try again, it gives the ‘your project contains errors’ message again.
- 2) Other projects run ok while problem persists with the project I’m working on.
- 3) I suspect it’s related to frequent code changes and frequent builds. The problem has appeared on more than one project but it’s always the main project I’m working on, the one on which I’m doing many code changes and builds.
I’m using Eclipse Java IDE for Web Developers, Juno SR1 with ADT v21 on Windows 7 Home Premium SP1.