Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I tap on Paypal in Android the App is Getting crashed #98

Open
satyanaryanamurthy opened this issue Aug 20, 2018 · 7 comments
Open

Comments

@satyanaryanamurthy
Copy link

satyanaryanamurthy commented Aug 20, 2018

Android App crashes suddenly when I click on the Paypal Button the credit card Payment was working fine, Previously it has worked now it is not working and no changes have been made to the code. I researched on the issue but had no luck. In IOS it is working fine.

FATAL EXCEPTION: main
Process: com.videokall, PID: 5787
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/paypal/android/sdk/data/collector/PayPalDataCollector;
at com.paypal.android.sdk.onetouch.core.PayPalOneTouchCore.getClientMetadataId(PayPalOneTouchCore.java:139)
at com.paypal.android.sdk.onetouch.core.CheckoutRequest.pairingId(CheckoutRequest.java:54)
at com.paypal.android.sdk.onetouch.core.BillingAgreementRequest.pairingId(BillingAgreementRequest.java:27)
at com.braintreepayments.api.PayPal.getBillingAgreementRequest(PayPal.java:570)
at com.braintreepayments.api.PayPal$2.success(PayPal.java:244)
at com.braintreepayments.api.internal.HttpClient$3.run(HttpClient.java:288)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6339)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.paypal.android.sdk.data.collector.PayPalDataCollector" on path: DexPathList[[zip file "/data/app/com.videokall-2/base.apk"],nativeLibraryDirectories=[/data/app/com.videokall-2/lib/arm, /data/app/com.videokall-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.paypal.android.sdk.onetouch.core.PayPalOneTouchCore.getClientMetadataId(PayPalOneTouchCore.java:139) 
at com.paypal.android.sdk.onetouch.core.CheckoutRequest.pairingId(CheckoutRequest.java:54) 
at com.paypal.android.sdk.onetouch.core.BillingAgreementRequest.pairingId(BillingAgreementRequest.java:27) 
at com.braintreepayments.api.PayPal.getBillingAgreementRequest(PayPal.java:570) 
at com.braintreepayments.api.PayPal$2.success(PayPal.java:244) 
at com.braintreepayments.api.internal.HttpClient$3.run(HttpClient.java:288) 
at android.os.Handler.handleCallback(Handler.java:836) 
at android.os.Handler.dispatchMessage(Handler.java:103) 
at android.os.Looper.loop(Looper.java:203) 
at android.app.ActivityThread.main(ActivityThread.java:6339) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945) 

@Smoodle
Copy link

Smoodle commented Aug 20, 2018

+1

Having the same issue. On iOS is working fine but android crashes as soon as BTClient.showPayPalViewController() is called.

My Code:

BTClient.showPayPalViewController()
           .then(function(nonce) {
               console.log("SUCESS");
               console.log(nonce);

               navigation.dispatch(setLoader(false));

               //payment succeeded, pass nonce to server
           })
           .catch(function(err) {
               console.log("ERR");
               console.log(err);

               navigation.dispatch(setLoader(false));

               //error handling
           });

Error with adb logcat :

08-20 14:29:05.087 17190 17190 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/paypal/android/sdk/data/collector/PayPalDataCollector;
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.paypal.android.sdk.onetouch.core.PayPalOneTouchCore.getClientMetadataId(PayPalOneTouchCore.java:139)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.paypal.android.sdk.onetouch.core.CheckoutRequest.pairingId(CheckoutRequest.java:54)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.paypal.android.sdk.onetouch.core.BillingAgreementRequest.pairingId(BillingAgreementRequest.java:27)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.braintreepayments.api.PayPal.getBillingAgreementRequest(PayPal.java:570)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.braintreepayments.api.PayPal$2.success(PayPal.java:244)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.braintreepayments.api.internal.HttpClient$3.run(HttpClient.java:288)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:789)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:98)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.paypal.android.sdk.data.collector.PayPalDataCollector" on path: DexPathList[[zip file "/data/app/com.example.example-K9nAu0M8nSDMaoR-1fhIeQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.example-K9nAu0M8nSDMaoR-1fhIeQ==/lib/arm, /data/app/com.example-K9nAu0M8nSDMaoR-1fhIeQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
08-20 14:29:05.087 17190 17190 E AndroidRuntime: ... 13 more

react-native-braintree-xplat: 4.0.0
react-native: 0.54.2

@VitorCodes
Copy link

I have the exact same issue, everything was working and from day to night the android app started crashing PayPal as well... I noticed that this happens in the latest version but not in lower ones.

@doublehrajput
Copy link

@xPotion I have downgrade react-native-braintree-xplat to 3.5.0 still I am getting Same Issue.

@VitorCodes
Copy link

@doubleh-rajput I tested the version 3.5.0 last time two days ago and it was okay. After reading your comment I checked it again and this issue is also in version 3.5.0. Now PayPal is officially broken in every app that I tested, with different versions and different android devices.

@doublehrajput
Copy link

So is there any other library for paypal integration for react-native?

@lkorth
Copy link

lkorth commented Aug 24, 2018

This is actually an issue with braintree/braintree_android, see braintree/braintree_android#229

@Smoodle
Copy link

Smoodle commented Aug 27, 2018

Found a solution for now thanks to @lkorth , just go to your node_modules/react-native-braintree-xplat/android/build.gradle and replace compile 'com.braintreepayments.api:braintree:2.+' with compile 'com.braintreepayments.api:braintree:2.14.2'

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

No branches or pull requests

5 participants