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

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

Posted by: admin May 14, 2020 Leave a comment

Questions:

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??

How to&Answers:

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.

Answer:

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.