Setting android:extractNativeLibs=false to reduce app size

后端 未结 3 1479
攒了一身酷
攒了一身酷 2020-12-06 10:29

I am not sure, if I got this right. It seems it is doing the oposite. If I keep the flag android:extractNativeLibs set to true, the app is taking about 70MB of user\'s space

3条回答
  •  醉话见心
    2020-12-06 11:12

    extractNativeLibs="false" could be counterproductive if your APK contains multiple ABIs. Let's say you're using a library which is 10 MB for each ABI and can be compressed to 5 MB. If you have 3 ABIs, then the result is:

    extractNativeLibs="true":

    APK:       15 MB (3 x 5 MB)
    Extracted: 10 MB
    Total:     25 MB
    

    extractNativeLibs="false":

    APK:       30 MB (3 x 10 MB)
    Extracted:  0 MB
    Total:     30 MB
    

    As of 2019, the recommended way to mitigate this is to use the Android App Bundle formet.

提交回复
热议问题