I have a project that is using a library project. The Library Project has draw9 (9.png) files and when building the apk via Ant it is stripping the draw9 info on scaleable and fillable areas. The result is that the app just stretches the images without using draw9 info. In Android's build.xml
<target name="-package-resources" depends="-crunch">
this is calling crunch, which updates the pre-processed PNG cache (anyone know where this cache is held?).
-crunch runs a task in aapt called crunch. But I have not been able to find any information on the arguments. It seems to be taking files from the Res folder and putting it in the out res folder (by default bin/res).
So I even cleared the task so it would not run crunch, and still images weren't stretched properly. I then replaced it with a straight copying of the png files to the out res folder, and still same issue. I even tried ant clean in between these tasks and I got the same problem. Which leads me to believe the cache is being held outside the project area, but where?
Note when I build it with Eclipse all is fine.
The other solution that works for me is to copy these images from the Library into the Main Project, but it's not the ideal solution.
Someone else seems to have had issues with this crunch/resource packaging with aapt in ant build uses cache from other projects
In this bug report they mention about the cache only using timestamps to check whether to update the cache or not.
This seems to be the source code for aapt, but I had trouble trying to find where this cache is held from reading it.
Figure out the problem
For me what was causing the problem was that I was using different folders (intentionally) in Ant for my res, src and bin. There is a refernce project.library.res.folder.path which gets filled in dependency macro. It points to the default res, and bin folders from the project. So what I did was to change them to point my new folders. But in doing that I was changing the older they were listed. It started mixing up the resource files into different library project I was using when aapt was being run. When I fixed the order it was compiling fine. I also did it for project.library.bin.r.file.path.