3

ウィクショナリー プロジェクトを Eclipse にインポートすると、strings.xmlファイルに関するエラー メッセージがすぐに表示されます。Subversion を介してプロジェクトをダウンロードした場合でも、SDK サンプル ファイルからプロジェクトをダウンロードした場合でも、同じエラーが発生します。

コンソール エラー:

[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').
4

3 に答える 3

3

Android Asset Packaging Tool (aapt) は、最新のリリースで非常に厳密になり、すべての Android バージョンで使用されるようになりました。取得している aapt-error は、非位置形式指定子が許可されなくなったため生成されます。

したがって、C:\Trunk\Wiktionary\res\values\strings.xml ファイルに変更を加える必要があります。

% の代わりに %% を使用し、プロジェクトをクリーンアップしてビルドします。

于 2010-12-29T05:58:58.337 に答える
3

ビルド ターゲットを 1.5 または 1.6 から 2.2 に変更します (API バージョン 8)

res\values\string.xml を更新し、% を %% に置き換えます

于 2011-09-08T20:31:04.033 に答える
3

私は同じ問題を経験しました。位置を指定するために 1$ と 2$ を追加するとうまくいきました。strings.xml から修正された行は次のとおりです。

<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>
于 2011-11-30T17:01:03.577 に答える