添加Paypal SDK后增加apk文件的大小

时间:2016-03-02 14:27:27

标签: android paypal-mobile-sdk paypal-android-sdk

添加了paypal sdk后,我的apk大小比其实际的apk大小增加了大约13 MB。使用PayPal sdk进行未来支付和添加的gradle链接

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

如何减小apk的大小?

2 个答案:

答案 0 :(得分:4)

如果您没有使用io.card,请将其从以下项目中删除:

disallowedContentRules

答案 1 :(得分:1)

而不是仅将此代码添加到build.gradle文件中。它删除了io卡扫描,因为io卡扫描增加了apk尺寸。

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'
    }
}