Reputation: 42928
I've been playing around with moving to Gradle, but realized our application size jumps up significantly by over 700kb for no real reason compared to our Ant build. I tried unzipping the APK files and rezipping them and they're more or less the same size.
Here is the ls
output, of both APKs and the resulting re-zips.
-rw-r--r-- 1 andrew staff 7814614 May 8 16:09 ant-built.apk
-rw-r--r-- 1 andrew staff 7927650 May 8 16:12 ant-zipped.zip
-rw-r--r-- 1 andrew staff 8534075 May 8 16:10 gradle-built.apk
-rw-r--r-- 1 andrew staff 7963004 May 8 16:12 gradle-zipped.zip
As you can see the Gradle output is way bigger, but when zipped it's mostly the same size as the zipped version of the Ant build. Is there any reason the Gradle file would be bigger by default? Both APKs are zipaligned and signed. The zips were compressed using the basic zip
command line. Not doing anything special in Ant or Gradle to make these builds.
Upvotes: 2
Views: 291
Reputation: 42928
It turns out we were doing an additional signing step in the ant build that was making the filesize smaller. Manually performing the two signing steps after an unsigned Gradle build creates equivalent sizes between Gradle and ant. Unfortunately I don't think it can be pinned down any further since it turns out I can't use Gradle's regular signingConfig for now.
Upvotes: 1