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

NullPointerException on 'void androidx.activity.result.ActivityResultLauncher.launch When Paying with Google Pay Using SDK Version 4.38.0 #1233

Open
ParthipanTRaja opened this issue Dec 6, 2024 · 1 comment

Comments

@ParthipanTRaja
Copy link

Braintree SDK Version

4.38.0

Environment

Production

Android Version & Device

Android 13, Android 14 , Samsung S23, S9

Braintree dependencies

implementation "com.braintreepayments.api:american-express:4.38.0"
implementation "com.braintreepayments.api:card:4.38.0"
implementation "com.braintreepayments.api:google-pay:4.38.0"
implementation "com.braintreepayments.api:paypal:4.38.0"
implementation "com.braintreepayments.api:three-d-secure:4.38.0"
implementation "com.braintreepayments.api:data-collector:4.38.0"

Describe the bug

I m getting this logs from firebase crashlytics when making payment via google pay.

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{/.BraintreeGooglePayActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.activity.result.ActivityResultLauncher.launch(java.lang.Object)' on a null object reference

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{*/.BraintreeGooglePayActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.activity.result.ActivityResultLauncher.launch(java.lang.Object)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3993)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4173)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:114)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:231)
at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:152)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:93)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2595)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

   Can anyone please help me to resolve this and help me identify what I missed?

To reproduce

  1. Click on google pay button
  2. It will make crash on Samsung device

Expected behavior

  1. Click on google pay button
  2. It should not crash and make payment

Screenshots

No response

@tdchow
Copy link
Collaborator

tdchow commented Dec 6, 2024

Hey @ParthipanTRaja - Thanks for reporting this issue.

Are you only seeing this crash in Firebase or can you reproduce this locally? If you're able to reproduce locally, can you try getting pulling the latest SDK version and trying again?

We have recently released a new major version, v5: https://github.com/braintree/braintree_android/releases

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

2 participants