bundletool icon indicating copy to clipboard operation
bundletool copied to clipboard

too many files in splits/base-ldpi.apk

Open PiR43 opened this issue 4 years ago • 0 comments

Describe the bug all the png version of a drawable are present in splits/base-ldpi.apk (only the ldpi version is wanted in this split)

Bundletool version(s) affected 1.8.1

Stacktrace unzip -l splits/base-ldpi.apk | grep test_image
1572 1981-01-01 01:01 res/drawable-anydpi-v24/test_image.xml 2037 1981-01-01 01:01 res/drawable-hdpi-v4/test_image.png 795 1981-01-01 01:01 res/drawable-ldpi-v4/test_image.png 1313 1981-01-01 01:01 res/drawable-mdpi-v4/test_image.png 2220 1981-01-01 01:01 res/drawable-xhdpi-v4/test_image.png 3377 1981-01-01 01:01 res/drawable-xxhdpi-v4/test_image.png 4718 1981-01-01 01:01 res/drawable-xxxhdpi-v4/test_image.png

To Reproduce wget -O app-debug.aab https://github.com/PiR43/bundletool/blob/master/src/test/resources/com/android/tools/build/bundletool/testdata/aab/app-debug.aab?raw=true java -jar /opt/bundletool-all-1.8.1.jar build-apks --bundle=app-debug.aab unzip full.apks unzip -l splits/base-ldpi.apk | grep test_image 1572 1981-01-01 01:01 res/drawable-anydpi-v24/test_image.xml 2037 1981-01-01 01:01 res/drawable-hdpi-v4/test_image.png 795 1981-01-01 01:01 res/drawable-ldpi-v4/test_image.png 1313 1981-01-01 01:01 res/drawable-mdpi-v4/test_image.png 2220 1981-01-01 01:01 res/drawable-xhdpi-v4/test_image.png 3377 1981-01-01 01:01 res/drawable-xxhdpi-v4/test_image.png 4718 1981-01-01 01:01 res/drawable-xxxhdpi-v4/test_image.png unzip -l splits/base-xhdpi.apk | grep test_image 1572 1981-01-01 01:01 res/drawable-anydpi-v24/test_image.xml unzip -l splits/base-master.apk | grep test_image 788 1981-01-01 01:01 res/drawable-anydpi-v24/$test_image__0.xml

Expected behavior I would like splits/base-ldpi.apk have only necessary resources files for be smaller.

Known workaround If you have found a workaround, please specify what it is.

Environment: N/A (Not installed on an device)

Additional context The test_image is included from an library (.aar) who have a lower min sdk (16) than the project (24) And it seems the problem is when project min sdk is the same than the xml drawable res/drawable-anydpi-v24/test_image.xml Perhaps in this case png are not necessary (the xml drawable is enougth) but why they are put in splits/base-ldpi.apk ?

PiR43 avatar Oct 11 '21 16:10 PiR43