11

After making target targetSdkVersion and compileSdkVersion to 26, my android apk size increased by 500kb.

Android apk size with(targetSdkVersion and compileSdkVersion as 25)=5.6mb

Android apk size with(targetSdkVersion and compileSdkVersion as 26)=6.2mb

After analyzing the apk I got to know that libs folder having ".so" only have increased size.

enter image description here

enter image description here

Can anyone suggest something what really happened and how to minimize this size change??

  • any luck with this? – Ivan Oct 24 '17 at 09:54
  • Not yet still looking for a good answer – Anish Kumar Dubey Oct 26 '17 at 08:08
  • Can you show your dependencies? Could have something to do with overriding gms or supports on all children as well, forcing the larger newer library into every single reference. I would expect it to be a little bigger – Sam Oct 27 '17 at 02:04
  • MB, size increased becose new api 26 add new feature? This is a payment for a new api. Of course you can use tricks to reduce which are applicable to other api. – Fortran Oct 28 '17 at 12:33

2 Answers2

1

Set the android:extractNativeLibs flag to false in the <application> element of your app manifest. This will prevent PackageManager from copying out .so files from the APK to the filesystem during installation and will have the added benefit of making delta updates of your app smaller.

MalemScha
  • 323
  • 1
  • 8
0

In Android, we can use Native code (C++) i.e. Android NDK (Native Development Kit) compiles this code into '.so' files. Refer Concept. So as you updated the Version, the '.so' files would also have updated. Thus the size got increased.

mithil1501
  • 506
  • 9
  • 20