我正在尝试通过从命令行使用 aapt 来构建 R.java。我指定多个-S
目录,因为我有多个res
目录。我正在使用以下方法构建:
aapt package \
-M AndroidManifest.xml \
-m -J gen \
-S src/com/example/res \
-S src/com/example/ui/res
不幸的是,我收到以下错误:
src/com/example/ui/res/values/strings.xml:2: error: Resource at app1_name appears in overlay but not in the base package; use <add-resource> to add.
目前,src/com/example/ui/res/values/strings.xml
包含以下内容:
<resources>
<string name="app1_name">MyAppName</string>
</resources>
我宁愿不必将其更改为:
<resources>
<add-resource type="string" name="app1_name">MyAppName</add-resource>
</resources>
(这是在https://groups.google.com/forum/?fromgroups#!topic/android-porting/bYfeLEjERjg上提出的,尽管它似乎并没有解决我的问题。)
我对-S
论证应该如何运作的期望是否被误导了?
我能想到的唯一解决方法是将我的所有目录符号链接-S
为根res
目录的子目录并指定res
为唯一-S
目录。