0

When I attempt to run my Android application I get the following message:

your project contains error(s), please fix them before running your application

All I did was to clean the application and everything went wrong.

Normally, you would see a red asterisk against the offending file and the corresponding line with the error. But in this case I get no such indication.

Screenshots:

enter image description here

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
sisko
  • 9,604
  • 20
  • 67
  • 139

3 Answers3

1

Sounds like you have a syntax error in one of your XML files, or an invalid file name.

When you do a clean it deletes certain files, it would then automatically build, if you have syntax errors the R.java file won't be generated and you will have the above error.

Blundell
  • 75,855
  • 30
  • 208
  • 233
  • Thank you Blundell, I checked the the R.java file is present in the generated folder. I then tried deleting and re-cleaning but it seemed to make no difference – sisko Jul 03 '11 at 17:42
  • hmm. A screenshot of your folder structure _might_ help then – Blundell Jul 03 '11 at 18:12
  • I have attached the screenshot to my original question above(I hope it is visible). And, thanks for your continued help. – sisko Jul 03 '11 at 18:22
  • Ctrl + '+' (expanding the content of the webpage) will make the screenshot's content more readable – sisko Jul 03 '11 at 18:29
  • Have you tried copying the files to a new project? Needed to expand the /res/ directory that's probably were the error is :-) – Blundell Jul 03 '11 at 18:57
  • I have included a screenshot with the res folder expanded. I'll copy to a new project if all else fails – sisko Jul 03 '11 at 19:19
  • You are going to pity me so brace yourself. I just successfully duplicated the project by importing it under a different name ... It had the same mysterious error problem! ;-( – sisko Jul 03 '11 at 22:28
  • I would create a complete new project. just copy the Java files, the XML layouts and write the manifest again. Or delete an activity 1 at a time till the error goes. – Blundell Jul 03 '11 at 22:38
0

you can check in android console(window->show view->console),it will give some more information,check it once,check your build path if your are import your project somewhere else and the project uses 3rd party libraries or you may have problems with your XML resources.

sunriser
  • 770
  • 3
  • 12
  • Hi Riser, the console is not yielding any hints. As for the XML files, I did ctrl+shift+f on them all to re-format and then I saved them but there is still no hint of the offending error – sisko Jul 03 '11 at 17:50
0

Found the source of my mysterious error.

It turns out it was a imported java class I had forgotten about which I wasn't using and caused the error to showup when I "cleaned" the project.

I visited the build path where I saw it had an associated error. I removed it and all was well.

sisko
  • 9,604
  • 20
  • 67
  • 139