如何在不使用<add-resource>的情况下使用aapt多个-S值?

bol*_*est 8 android aapt

我试图通过从命令行使用aapt来构建R.java.我指定多个-S目录,因为我有多个res目录.我正在建设中使用:

aapt package \
  -M AndroidManifest.xml \
  -m -J gen \
  -S src/com/example/res \
  -S src/com/example/ui/res
Run Code Online (Sandbox Code Playgroud)

不幸的是,我收到以下错误:

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.
Run Code Online (Sandbox Code Playgroud)

目前,src/com/example/ui/res/values/strings.xml包含以下内容:

<resources>
    <string name="app1_name">MyAppName</string>
</resources>
Run Code Online (Sandbox Code Playgroud)

我宁愿不必改为:

<resources>
    <add-resource type="string" name="app1_name">MyAppName</add-resource>
</resources>
Run Code Online (Sandbox Code Playgroud)

(这是在https://groups.google.com/forum/?fromgroups#!topic/android-porting/bYfeLEjERjg上建议的,虽然它似乎无法解决我的问题.)

我是否因为期望-S论证如何运作而误入歧途?

我能想到的唯一解决方法是将所有-S目录作为根res目录的子目录进行符号链接,并指定res为唯一的-S目录.

bol*_*est 14

我相信解决方案是使用--auto-add-overlay标志.我通过使用-vfor verbose模式运行默认的Ant构建脚本来发现这一点.