I ran into the same problem trying to build the wiktionary example code that I downloaded from code.google.com ( here ) I imported into a new Eclipse Juno project designed to use Android 4.1 and JDK 1.6.
Here is an excerpt from the console after creating the project:
W / ResourceType (6292): Bad XML block: header size 103 or total size 0 greater than data size 0 C: \ Development \ WorkJava \ android \ sampleapps \ Wiktionary \ com.example.android.wiktionary.LookupActivity \ res \ values \ Strings.xml: 23: error: several substitutions specified in non-positional format; did you want to add the formatted = "false" attribute? C: \ Development \ WorkJava \ android \ sampleapps \ Wiktionary \ com.example.android.wiktionary.LookupActivity \ res \ values ββ\ strings.xml: 23: error: Unexpected end tag string
Here is an excerpt from res / values ββ/string.xml:
<resources> <string name="app_name">Wiktionary Word of the Day</string> <string name="app_descrip">A fast Wiktionary browser and Word-of-day widget</string> <string name="app_credits">"All dictionary content provided by Wiktionary under a GFDL license. http://en.wiktionary.org\n\nIcon derived from Tango Desktop Project under a public domain license. http://tango.freedesktop.org".</string> <string name="template_user_agent">"%s/%s (Linux; Android)"</string> <string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string> <string name="template_wotd_archive_title">"Wiktionary:Word_of_the_day/Archive/%s/%s"</string>
Decision
Adding formatted = "false" to the last 3 line definitions (containing two% s placeholder substitutions), as shown below, solved the problem. Project recovery created R.java in the gen folder.
<resources> <string name="app_name">Wiktionary Word of the Day</string> <string name="app_descrip">A fast Wiktionary browser and Word-of-day widget</string> <string name="app_credits">"All dictionary content provided by Wiktionary under a GFDL license. http://en.wiktionary.org\n\nIcon derived from Tango Desktop Project under a public domain license. http://tango.freedesktop.org".</string> <string name="template_user_agent" formatted="false">"%s/%s (Linux; Android)"</string> <string name="template_wotd_title" formatted="false">"Wiktionary:Word of the day/%s %s"</string> <string name="template_wotd_archive_title" formatted="false">"Wiktionary:Word_of_the_day/Archive/%s/%s"</string>
Jean-pierre schnyder
source share