Android aapt add command fails when zip file reaches a particular size

888 Views Asked by At

I am having an issue with adding a large amount of video files to an APK. First it's worth mentioning this APK will not go on the Play store so there are no limits in APK size in principal.

Essentially when building for Android with Unity I noticed once the videos files combined passed the 2 GB mark, they would fail when the APK was being packaged as a Zip.

I decided to remove the video files and build the APK without them and then try using the aapt build tool in CMD to manually add each video. It appears that when using this tool I hit the same issue as in Unity at the 2GB mark.

Does anyone know why I seem to be receiving the below message when the content reaches the 2GB total size mark? Is there a logical limit, can I bypass it somehow? Is it maybe something else that is misleading me?

C:\Users\B\AppData\Local\Android\sdk\build-tools\26.0.1>aapt add -v `"C:\Users\B\Desktop\0.0.7.apk.zip" "C:\Users\B\Downloads\LE_ACT_3.mp4"`

ERROR: failed opening/creating 'C:\Users\B\Desktop\0.0.7.apk.zip' as Zip file

Thanks and happy to take advice on how to package up another way also.

1

There are 1 best solutions below

0
On

Its due to the expansion file size limit for Android APK's, which is 2GB. 2GB for the main expansion and 2GB for the patch equals 4GB. I can rest easy but it's made life harder for me.