Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Disabling card.io card scanning #226

Closed
ChristianKatzmann opened this issue Dec 10, 2015 · 12 comments
Closed

Disabling card.io card scanning #226

ChristianKatzmann opened this issue Dec 10, 2015 · 12 comments
Labels

Comments

@ChristianKatzmann
Copy link

Is it still possible to disable the Card.io Card Scanning for the new Maven artifact? Is it enough to simply exclude the transitive card.io dependency:

    compile('com.paypal.sdk:paypal-android-sdk:2.12.3') {
        exclude group: 'io.card'
    }

Afterwards I would still have to remove the CAMERA and VIBRATE permissions via Manifest merger. My question is if this is the proper way since https://github.com/paypal/PayPal-Android-SDK#disabling-cardio-card-scanning seems to be outdated.

@ChristianKatzmann
Copy link
Author

Ok, completely removing the transitive card.io dependency is not working as it will result in a ClassNotFoundException on CreditCard.

But manually excluding all the JNI files in the packagingOptions is a temporary hack:

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

@jaypatel512
Copy link
Contributor

Unfortunately @ChristianBecker, this would be our official solution for now to disable card.io. I will continue to see if we could remove the dependency from card.io completely that would eventually make it easy to remove that. However, for now, we would have to stick to this solution.

@jaypatel512
Copy link
Contributor

Updated the documentation in 2.12.4 release.

@philecom
Copy link

philecom commented Jan 4, 2017

@ChristianBecker Please can you add steps you took in Disabling card.io card scanning, including the files that needs to be modified and/or removed.
I am facing the same situation and adding
compile('com.paypal.sdk:paypal-android-sdk:2.12.3') { exclude group: 'io.card' }
build.gradle Seems NOT to reduce the files size. It actually get removed when i am building the apk.

@jaypatel512 Do you still have a better option in removing the Card.io or is possible reduce the file size of the app.

thank you

@jaypatel512
Copy link
Contributor

Hey @philecom !

Using the steps mentioned at https://github.com/paypal/PayPal-Android-SDK#disabling-direct-credit-card-payments should help you remove card.io dependency completely. This should reduce your apk size substantially. Can you please elaborate on what you mean by

build.gradle Seems NOT to reduce the files size. It actually get removed when i am building the apk.

@philecom
Copy link

philecom commented Jan 5, 2017

What I mean is that. when I add
compile('com.paypal.sdk:paypal-android-sdk:2.15.1') { exclude group: 'io.card' }
to the dependencies under "\platforms\android\build.gradle" and i compile, my app size still remains the same at 33.31MB. which was 15MB before adding the paypal SDK.

@jaypatel512
Copy link
Contributor

Hey @philecom !

I was not able to reproduce this issue. I added similar exclusion to SampleApp packaged in this project, and I was able to see apk size difference (2 MB instead of 15 MB). Can you please see if you can add the same exclusion and try it in the sample app to determine the root cause.

@philecom
Copy link

philecom commented Jan 5, 2017

@jaypatel512 can you show me the location of the file you added the exclusion to? and maybe where you added it to. Thanks

@jaypatel512
Copy link
Contributor

Here are the steps to reproduce my setup:

  • Do a git clone on our repository, or download the zip git clone [email protected]:paypal/PayPal-Android-SDK.git
  • cd SampleApp

Open build.gradle, and replace dependencies at Line 87 with this:

dependencies {
    compile('com.paypal.sdk:paypal-android-sdk:2.15.1') {
        exclude group: 'io.card'
    }
    compile 'com.google.android.gms:play-services-wallet:8.4.0'

    testCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
    androidTestCompile 'com.github.lkorth:device-automator:30238040d8'
    testCompile 'com.google.dexmaker:dexmaker-mockito:1.1'
    testCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
    testCompile 'com.android.support.test.espresso:espresso-web:2.2.1'
    testCompile 'com.android.support.test:runner:0.4.1'
    testCompile 'com.android.support.test:rules:0.4.1'
}
  • ./gradlew clean build
  • check /SampleApp/build/outputs/apk/ directory, and check the apk size.

@philecom
Copy link

philecom commented Jan 6, 2017

@jaypatel512 Thank you for your responds
"Open build.gradle, and replace dependencies at Line 87 with this:"
Kindly show me location of the "build.gradle" file.

@jaypatel512
Copy link
Contributor

@MerlinYu
Copy link

MerlinYu commented Mar 6, 2017

I have a problem when I use payday to pay I can't scan a check, what Happened? @jaypatel512

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants