-
Notifications
You must be signed in to change notification settings - Fork 127
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
App Crashes on Cancel or after payment #176
Comments
Is it just on a particular android version ? |
I tried it on 2 real devices (S23FE and A13) and 3 or 4 different emulators. It behaves the same on all of them. Is working fine on iOS, on issues whatsoever. |
Try this on a device/emulator other than Samsung (it seems to happen on Samsung devices only). |
Well, I tested it out on Google pixel 6 and 4 emulators and does the same thing. I don't think that it's a Samsung only problem, and even if it is when half of the android devices are Samsung .... Devices I tested it on are:
Real Devices
iOS Simulator
Working on iOS crashing on Android. |
Yeah I see that especially on Android 14. |
Thank you. I gave up on this for now and implemented a different payment solution, away from paypal and braintree. |
I am trying to implement the braintree flow in my app and it seems to work until I click "Cancel and return to.." or I go through the entire payment process and crashes when it has to return to the app.
This is the error I get
E/AndroidRuntime(11837): FATAL EXCEPTION: main
E/AndroidRuntime(11837): Process: net.castanet.app, PID: 11837
E/AndroidRuntime(11837): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.castanet.app/com.braintreepayments.api.DropInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645)
E/AndroidRuntime(11837): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
E/AndroidRuntime(11837): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(11837): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(11837): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
E/AndroidRuntime(11837): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(11837): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(11837): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(11837): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/AndroidRuntime(11837): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11837): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(11837): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(11837): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.getDropInRequest(DropInActivity.java:124)
E/AndroidRuntime(11837): at com.braintreepayments.api.DropInActivity.onCreate(DropInActivity.java:78)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8305)
E/AndroidRuntime(11837): at android.app.Activity.performCreate(Activity.java:8284)
E/AndroidRuntime(11837): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
E/AndroidRuntime(11837): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
E/AndroidRuntime(11837): ... 12 more
I/Process (11837): Sending signal. PID: 11837 SIG: 9
Lost connection to device.
Exited.
This is my android manifest
And this is the function for triggering the payment process
void startPayPalPayment(price, message, token) async {
final request = BraintreeDropInRequest(
clientToken: token,
collectDeviceData: true,
paypalRequest: BraintreePayPalRequest(
amount: price,
displayName: 'Castanet',
),
);
BraintreeDropInResult? result = await BraintreeDropIn.start(request);
if (result != null) {
print('Nonce: ${result.paymentMethodNonce.nonce}');
} else {
print('Selection was canceled.');
}
}
Any help is much appreciated.
The text was updated successfully, but these errors were encountered: