Android aaptOptions nocompress


(Jonathan Peppers) #1

Hi everyone,

I am new to gradle, trying to configure some custom stuff in my Android app. I have an AAR file that includes an Android library and some custom files that need to be included in the final APK but not compressed.

So in my app, I added this:
> aaptOptions {
>     noCompress ‘dll’
> }

This works correctly in my final APK as long as the files are inside /assets/, I can see the files uncompressed. If they are in a custom directory, such as /assemblies/ then they are not compressed. I am seeing the same thing if the assets are coming from either my AAR library or the main app.

Here is zipinfo of my apk:

$ zipinfo app/build/outputs/apk/app-debug.apk | grep dll$
-rw---- 2.0 fat 1788928 bx defN 69-Dec-31 18:00 assemblies/fromMyAar.dll
-rw---- 2.4 fat 1788928 b- stor 80-000-00 00:00 assets/fromMyAar.dll

Note the stor one is uncompressed.

Any ideas on a way for this to work? I need *.dll files in the final apk uncompressed in an /assemblies/ directory.