Increase size of apk file after added Paypal SDK

2019-05-31 02:48发布

After added paypal sdk my apk size increses about 13 mb from its actual apk size. Used PayPal sdk for futur payment in andoird and gradle link added

compile('com.paypal.sdk:paypal-android-sdk:2.13.1')

how to reduce size for apk?

2条回答
我命由我不由天
2楼-- · 2019-05-31 03:18

If you aren't using io.card remove it from project like:

compile('com.paypal.sdk:paypal-android-sdk:2.12.3') {
    exclude group: 'io.card'
}
查看更多
冷血范
3楼-- · 2019-05-31 03:23

instead of that just add this code into your build.gradle file. it removes io card scanning because io card scanning increases apk size.

android{
packagingOptions{
        exclude 'AndroidManifest.xml'
        exclude 'lib/arm64-v8a/libcardioDecider.so'
        exclude 'lib/arm64-v8a/libcardioRecognizer.so'
        exclude 'lib/arm64-v8a/libcardioRecognizer_tegra2.so'
        exclude 'lib/arm64-v8a/libopencv_core.so'
        exclude 'lib/arm64-v8a/libopencv_imgproc.so'
        exclude 'lib/armeabi/libcardioDecider.so'
        exclude 'lib/armeabi-v7a/libcardioDecider.so'
        exclude 'lib/armeabi-v7a/libcardioRecognizer.so'
        exclude 'lib/armeabi-v7a/libcardioRecognizer_tegra2.so'
        exclude 'lib/armeabi-v7a/libopencv_core.so'
        exclude 'lib/armeabi-v7a/libopencv_imgproc.so'
        exclude 'lib/mips/libcardioDecider.so'
        exclude 'lib/x86/libcardioDecider.so'
        exclude 'lib/x86/libcardioRecognizer.so'
        exclude 'lib/x86/libcardioRecognizer_tegra2.so'
        exclude 'lib/x86/libopencv_core.so'
        exclude 'lib/x86/libopencv_imgproc.so'
        exclude 'lib/x86_64/libcardioDecider.so'
        exclude 'lib/x86_64/libcardioRecognizer.so'
        exclude 'lib/x86_64/libcardioRecognizer_tegra2.so'
        exclude 'lib/x86_64/libopencv_core.so'
        exclude 'lib/x86_64/libopencv_imgproc.so'
    }
}
查看更多
登录 后发表回答