3

When importing the Wiktionary project into Eclipse, I immediately get error messages related to my strings.xml file. The same errors occur whether I download the project through subversion or from the SDK sample files.

Console errors:

[2010-12-27 15:25:33 - Wiktionary] W/ResourceType( 2752): Bad XML block: header size 62 or total size 0 is larger than data size 0
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\values\strings.xml:22: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\values\strings.xml:22: error: Unexpected end tag string
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\layout\widget_message.xml:24: error: Error: No resource found that matches the given name (at 'text' with value '@string/widget_loading').
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\xml\searchable.xml:17: error: Error: No resource found that matches the given name (at 'label' with value '@string/search_label').
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\xml\searchable.xml:17: error: Error: No resource found that matches the given name (at 'hint' with value '@string/search_hint').
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:19: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_search').
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:24: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_random').
[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:29: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_about').
Chris Cashwell
  • 22,308
  • 13
  • 63
  • 94
user555361
  • 31
  • 2

3 Answers3

3

The Android Asset Packaging Tool (aapt) has become very strict in its latest release and is now used for all Android versions. The aapt-error you're getting is generated because it no longer allows non-positional format specifiers.

So you have to make some changes into your C:\Trunk\Wiktionary\res\values\strings.xml file.

Use %% instead of % and then clean and build the project.

Shraddha Shravagi
  • 1,096
  • 1
  • 9
  • 22
  • I appreciate the response. Made the change still get the error. I seem to have a problem with widget_word.xml as well it is x'd in eclipse. Could I have the wrong strings.xml or widget_word.xml? – user555361 Dec 30 '10 at 21:20
  • Was facing same error with 2.2 sample of SearchableDictionary. Your suggestion fixed it. – vivek.m Feb 19 '12 at 18:07
3

Change build target from 1.5 or 1.6 to 2.2 (API version 8)

Update res\values\string.xml and replace % with %%

BigUser
  • 1,957
  • 2
  • 14
  • 10
3

I experienced the same problem. Adding 1$ & 2$ to specify positions did the trick. The corrected lines from strings.xml are:

<string name="template_user_agent">"%1$s/%2$s (Linux; Android)"</string>
<string name="template_wotd_title">"Wiktionary:Word of the day/%1$s %2$s"</string>
Jim Vitek
  • 4,174
  • 3
  • 23
  • 32