tags:

views:

41

answers:

1

I googled a lot to find various hints what could cause this problem. Many of them on this forum, but nothing works.

I installed the sdk from scratch on 3 different machines (xp, macos snow leopard, leopard) and always the same problem, that even the sample code in the android sdk doesn't compile. After hours of looking through the xml files I recognized, that when I remove ' from strings the sample code of the sdk will compile. So does a new project, as long there is no change needed in the R.java file. As soon as I try to add a button with findViewByID, I get the error that the field R.id cannot be resolved. No other changes were done to the project.

As mentioned before I tried various things, including: clean project, rebuild restart eclipse update sdk (even tough I installed the new sdk) no uppercase letters ... Install sdk, latest eclipse classic on a clean machine

I don't think it's an issue of the code itself, because even the sample code provided by the sdk doesn't compile without removing ' from the xml.

Please somebody has some hints and ideas where to look next please?

+1  A: 

open the "problems" window in eclipse, if there are any issues in any of the xml files, R.java will not generate.

if there are single quotes in the xml files, they should be replaced with double quotes. the XML standard is that all attribute values be surrounded by double quotes, not single quotes.

Invalid

<?xml version='1.0' encoding='utf-8' ?>
<resources>
  <string name='some_name'>value</string> 
</resournces>

Valid

<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <string name="some_name">value</string> 
</resournces>
Ryan Conrad
Hi! thanks for quick reply. Sadly that's not the problem. I found the issue in the sdk's sample code in strings.xml on line 365 <string name="summary_on_advanced_toggle_preference">I'm on</string>When I remove the ' from I'm and all other ' it works.But as mentioned above, even without any modifications after setting up a new project (which runs as long as I don't add a UIControl), but as soon as I make e.g. a button, the compiler fails.BTW I use Eclipse 3.5.2, and tried 3.6
wassx
what is the error in the output window or in the "problems" window?
Ryan Conrad