首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导入Wiktionary时出现构建错误

导入Wiktionary时出现构建错误
EN

Stack Overflow用户
提问于 2010-12-28 05:09:17
回答 3查看 1.9K关注 0票数 3

在将Wiktionary项目导入到Eclipse中时,我立即得到与我的strings.xml文件相关的错误消息。无论我是通过subversion还是从SDK示例文件下载项目,都会出现相同的错误。

控制台错误:

代码语言:javascript
复制
[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').
EN

回答 3

Stack Overflow用户

发布于 2010-12-29 13:58:58

Android Asset Packaging Tool (aapt)在其最新版本中变得非常严格,现在用于所有Android版本。生成aapt-error是因为它不再允许非位置格式说明符。

因此,您必须对C:\Trunk\Wiktionary\res\values\strings.xml文件进行一些更改。

使用%%而不是%,然后清理并构建项目。

票数 3
EN

Stack Overflow用户

发布于 2011-09-09 04:31:04

将构建目标从1.5或1.6更改为2.2 (API版本8)

更新res\values\string.xml并将%%替换为%%

票数 3
EN

Stack Overflow用户

发布于 2011-12-01 01:01:04

我也遇到过同样的问题。添加1$ & 2$来指定位置就行了。从strings.xml中更正的行是:

代码语言:javascript
复制
<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>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4541858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档