You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple users are getting an IllegalStateException when trying to pay using Google Pay. We applied previous workarounds such as the proposed in issue 543 but it doesn't seem to work anymore.
Here you can see the logs:
Fatal Exception: java.lang.IllegalStateException
Attempting to launch an unregistered ActivityResultLauncher with contract com.braintreepayments.api.A@17860a and input com.braintreepayments.api.D@a974e7b. You must ensure the ActivityResultLauncher is registered before calling launch().
Fatal Exception: java.lang.IllegalStateException: Attempting to launch an unregistered ActivityResultLauncher with contract com.braintreepayments.api.A@17860a and input com.braintreepayments.api.D@a974e7b. You must ensure the ActivityResultLauncher is registered before calling launch().
at androidx.activity.result.ActivityResultRegistry$2.launch(ActivityResultRegistry.java:166)
at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)
at com.braintreepayments.api.GooglePayLifecycleObserver.launch(GooglePayLifecycleObserver.java:44)
at com.braintreepayments.api.GooglePayClient$4$1.onResult(GooglePayClient.java:296)
at com.braintreepayments.api.BraintreeClient.getConfiguration$lambda-1$lambda-0(BraintreeClient.java:190)
at com.braintreepayments.api.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:30)
at com.braintreepayments.api.BraintreeClient.getConfiguration$lambda-1(BraintreeClient.java:188)
at com.braintreepayments.api.AuthorizationLoader.loadAuthorization(AuthorizationLoader.java:12)
at com.braintreepayments.api.BraintreeClient.getAuthorization(BraintreeClient.kt:206)
at com.braintreepayments.api.BraintreeClient.getConfiguration(BraintreeClient.kt:186)
at com.braintreepayments.api.GooglePayClient$4.onAuthorizationResult(GooglePayClient.java:275)
at com.braintreepayments.api.AuthorizationLoader.loadAuthorization(AuthorizationLoader.java:12)
at com.braintreepayments.api.BraintreeClient.getAuthorization(BraintreeClient.kt:206)
at com.braintreepayments.api.GooglePayClient.requestPayment(GooglePayClient.java:271)
at com.braintreepayments.api.GooglePayClient.requestPayment(GooglePayClient.java:228)
at com.myapplication.googlepay.impl.service.GooglePayService.requestGooglePayment$lambda$7(GooglePayService.java:337)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
The implementation of our GooglePayService looks like this:
The initGooglePayClient function is called in the onCreate method of our FragmentActivity.
The requestGooglePayment is called in the onStart method of the same FragmentActivity.
In both cases, we use the GooglePayService you can see in the logs to do some checks -such as if the FragmentActivity used for creating the instance of the GooglePayClient is the same than the used when requesting Google payment-.
To reproduce
Select Google Pay as the payment method.
The Braintree SDK tries to launch Google Pay.
Expected behavior
The BottomSheet/Activity is launched properly and the user is able to interact with it.
Screenshots
No response
The text was updated successfully, but these errors were encountered:
Braintree SDK Version
4.49.1
Environment
Production
Android Version & Device
Pixel 8 Pro - Android 14
Braintree dependencies
com.braintreepayments.api:braintree-core:4.49.1
com.braintreepayments.api:data-collector:4.49.1
com.braintreepayments.api:google-pay:4.49.1
com.braintreepayments.api:three-d-secure:4.49.1
Describe the bug
Multiple users are getting an
IllegalStateException
when trying to pay using Google Pay. We applied previous workarounds such as the proposed in issue 543 but it doesn't seem to work anymore.Here you can see the logs:
The implementation of our GooglePayService looks like this:
The
initGooglePayClient
function is called in theonCreate
method of ourFragmentActivity
.The
requestGooglePayment
is called in theonStart
method of the sameFragmentActivity
.In both cases, we use the
GooglePayService
you can see in the logs to do some checks -such as if theFragmentActivity
used for creating the instance of theGooglePayClient
is the same than the used when requesting Google payment-.To reproduce
Expected behavior
The
BottomSheet
/Activity
is launched properly and the user is able to interact with it.Screenshots
No response
The text was updated successfully, but these errors were encountered: