wholerabbit
wholerabbit

Reputation: 11536

Force aapt to re-evaluate raw resources during build

I have raw resources that are occasionally swapped or modified between builds without the file name being changed, and aapt does not incorporate the changes; it uses a previous version of bin/MyThing.ap_ (I'm guessing this is where they've been stashed). From ant debug:

     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
...
-package-resources:
     [aapt] No changed resources or assets. WhereWhen.ap_ remains untouched

The only way around this I've found is to move/rename the files, build, then move/rename them back and build again.

Searching online I notice there are some point and click settings in Eclipse to force refreshing the resources appropriately, but I'm not using Eclipse. Is there something I can set in the ant file, etc?

Upvotes: 1

Views: 190

Answers (1)

HMK
HMK

Reputation: 574

I encountered the same problem when using obfuscation and releasing for various channels. The root cause is that aapt use source files' timestamp to judge whether exists changed resources. More reliable solution is to change any source file's timestamp, AndroidManifest.xml recommended. I use ant or build.xml to do this before call release in ant.

<touch file="AndroidManifest.xml" datetime="now"/>
<antcall target="release" />

Upvotes: 1

Related Questions