Updated 14 December 2016
If you are using the PayPal SDK and want to make the standard payment, simply you have to write this compiled code in your build.gradle,
1 |
compile('com.paypal.sdk:paypal-android-sdk:2.14.1') |
After that, if you noticed the size of the app(.apk) increases twice or thrice(approx 10 -12mb increased).
What is the reason behind it?
> io.card module is the reason.
If you have simply excluded this io.card module from the PayPal SDK:
1 2 3 4 |
compile('com.paypal.sdk:paypal-android-sdk:2.14.1') { exclude group: 'io.card' } |
the app size will be reduced.
But there is one problem to exclude this module, You will not make the payment by your debit/credit card.
There is two option to make payment by card,
And the main reason behind increasing the app size is the First option, automatically card scanner.
So what will have to do?
We have to exclude only the automatically card scanner option from the app.
So we have to add packagingOptions where we have to exclude the card scanner related files which have included the .so file instead of the whole io.card module.
In the build.gradle,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
packagingOptions { 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' } |
paste above file parallels to defaultConfig. After this app size will be reduce and you can also use the direct card payment option.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.