Skip to content

App crashes after tapping “Continue” on 3DS challenge screen in landscape mode #1329

@towfurious

Description

@towfurious

Braintree SDK Version

4.50.0

Environment

Production

Android Version & Device

Pixel 9 Pro XL - Android 15, Galaxy S25 Ultra - Android 15, Galaxy S22 - Android 14, Galaxy S20 FE - Android 13

Braintree dependencies

implementation 'com.braintreepayments.api:drop-in:6.17.0'
implementation 'com.braintreepayments.api:data-collector:4.50.0'
implementation 'com.braintreepayments.api:three-d-secure:4.50.0'

Describe the bug

Description:

When a user rotates the device to landscape orientation while on the 3DS challenge screen and taps the “Continue” button, the app crashes. This behavior occurs regardless of whether the user has confirmed the transaction in the bank’s app.

Important Note:
• Simply rotating the device, minimizing the app (backgrounding), and returning does not cause a crash.
• The crash only occurs when “Continue” is tapped in landscape mode.

Please see logs:
java.lang.IllegalStateException: Attempting to launch an unregistered ActivityResultLauncher with contract androidx.activity.result.contract.ActivityResultContracts$StartActivityForResult@778822b and input Intent { flg=0x4000000 cmp=/<REDACTED>/com.cardinalcommerce.shared.cs.userinterfaces.ChallengeNativeView (has extras) }. 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.cardinalcommerce.a.cca_continue.init(SourceFile:139) at com.cardinalcommerce.a.cca_continue.onCReqSuccess(SourceFile:236) at com.cardinalcommerce.a.values.cca_continue(SourceFile:81) at com.cardinalcommerce.a.setBaselineAlignBottom$4.run(SourceFile:119) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

Additional Info:
We can see the same error logs but different scenario here
We can see the same steps and similar behavior here

To reproduce

Steps to Reproduce:
1. Trigger a payment that requires 3DS challenge authentication.
2. When the 3DS challenge screen appears, rotate the device to landscape orientation.
3. Tap the “Continue” button.
4. Observe: the app crashes.

Expected behavior

Expected Result:
The 3DS flow should complete without crashing the app, even in landscape mode.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions