3D-Secure redirect - Configuration not restored after Activity is resumed "Unable to resume activity DropInActivity"
See original GitHub issueGeneral information
- Drop In Ui version 3.20
- Braintree 2.8.1
- Environment: Debug Mode
- Android Version and Device: Infinix Zero 3 with Android 6.0
Issue description
The user is redirected to a 3D-Secure page and later returns to the Drop In UI activity. The activity is crashing the app. The Android life cycle is not properly implemented. When the Drop-In UI activity is destroyed and should be resumed the configuration seems to be lost. This can be simulated when going to Developer Options -> “Don’t keep activities”. This destroys the activity.
E/UncaughtException: java.lang.RuntimeException: Unable to resume activity {com.simless.app/com.braintreepayments.api.dropin.DropInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.braintreepayments.api.models.Configuration.isThreeDSecureEnabled()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3269)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3300)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1465)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5683)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.braintreepayments.api.models.Configuration.isThreeDSecureEnabled()' on a null object reference
at com.braintreepayments.api.dropin.BaseActivity.shouldRequestThreeDSecureVerification(BaseActivity.java:50)
at com.braintreepayments.api.dropin.DropInActivity.onPaymentMethodNonceCreated(DropInActivity.java:202)
at com.braintreepayments.api.BraintreeFragment$4.run(BraintreeFragment.java:577)
at com.braintreepayments.api.BraintreeFragment.flushCallbacks(BraintreeFragment.java:684)
at com.braintreepayments.api.BraintreeFragment.addListener(BraintreeFragment.java:397)
at com.braintreepayments.api.BraintreeFragment.onResume(BraintreeFragment.java:236)
at android.app.Fragment.performResume(Fragment.java:2279)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1013)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1135)
at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1990)
at android.app.FragmentController.dispatchResume(FragmentController.java:174)
at android.app.Activity.performResume(Activity.java:6366)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3254)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3300)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1465)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5683)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
D/SQLiteDatabase: Open database
java.lang.Throwable: stacktrace
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:815)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:576)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:269)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at com.braintreepayments.api.internal.AnalyticsDatabase$1.run(AnalyticsDatabase.java:74)
at com.braintreepayments.api.internal.AnalyticsDatabase$DatabaseTask.doInBackground(AnalyticsDatabase.java:187)
at com.braintreepayments.api.internal.AnalyticsDatabase$DatabaseTask.doInBackground(AnalyticsDatabase.java:176)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.simless.app, PID: 17272
java.lang.RuntimeException: Unable to resume activity {com.simless.app/com.braintreepayments.api.dropin.DropInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.braintreepayments.api.models.Configuration.isThreeDSecureEnabled()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3269)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3300)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1465)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5683)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.braintreepayments.api.models.Configuration.isThreeDSecureEnabled()' on a null object reference
at com.braintreepayments.api.dropin.BaseActivity.shouldRequestThreeDSecureVerification(BaseActivity.java:50)
at com.braintreepayments.api.dropin.DropInActivity.onPaymentMethodNonceCreated(DropInActivity.java:202)
at com.braintreepayments.api.BraintreeFragment$4.run(BraintreeFragment.java:577)
at com.braintreepayments.api.BraintreeFragment.flushCallbacks(BraintreeFragment.java:684)
at com.braintreepayments.api.BraintreeFragment.addListener(BraintreeFragment.java:397)
at com.braintreepayments.api.BraintreeFragment.onResume(BraintreeFragment.java:236)
at android.app.Fragment.performResume(Fragment.java:2279)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1013)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1135)
at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1990)
at android.app.FragmentController.dispatchResume(FragmentController.java:174)
at android.app.Activity.performResume(Activity.java:6366)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3254)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3300)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1465)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5683)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Unable to resume activity(containing a SupportMapFragment ...
When I exit the fragment and come back or move around in different fragments and come back to this map fragment, I get...
Read more >Release Notes for Cisco DNA Center, Release 2.2.3.x
With the Group-Based Access Control Policy dashboard, you can view a summary of network activity, policy-related issues, and traffic trends.
Read more >PCI-DSS-v4_0.pdf
The Payment Card Industry Data Security Standard (PCI DSS) was developed to encourage and enhance payment card account data security.
Read more >vSphere Security | VMware Docs
Configuring Smart Card Authentication for ESXi 111 ... In vSphere 6.0 and later, the VMware Certificate Authority (VMCA) provisions each ...
Read more >NetSuite Applications Suite - End of Support for 3D Secure 1
Drop Shipping Preferences ... 3D Secure Payment Authentication · End of Support for 3D ... Best Practices for Syncing Inactive Items in NetSuite...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I get now the error: “Nonce is already 3D Secure” when the activity is recreated after returning from 3DS. There seems to be still an issue.
The latest, 3.4.0 https://github.com/braintree/braintree-android-drop-in/blob/master/CHANGELOG.md#340 which includes an update to the underlying android sdk which has a 3ds fix: https://github.com/braintree/braintree_android/blob/master/CHANGELOG.md#2131