I am trying to build R.java by using aapt from the command line. I am specifying multiple -S
directories because I have multiple res
directories. I am building by using:
aapt package \
-M AndroidManifest.xml \
-m -J gen \
-S src/com/example/res \
-S src/com/example/ui/res
Unfortunately, I am getting the following error:
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.
Currently, src/com/example/ui/res/values/strings.xml
contains the following:
<resources>
<string name="app1_name">MyAppName</string>
</resources>
I would prefer not to have to change this to:
<resources>
<add-resource type="string" name="app1_name">MyAppName</add-resource>
</resources>
(This was suggested on https://groups.google.com/forum/?fromgroups#!topic/android-porting/bYfeLEjERjg, though it does not even seem to solve my problem.)
Am I misguided in my expectation of how the -S
argument should work?
The only workaround I can think of is to symlink all of my -S
directories as subdirectories of the root res
directory and to specify res
as the only -S
directory.
I believe the solution is to use the --auto-add-overlay
flag. I discovered this by running the default Ant build script with -v
for verbose mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With