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

Stripeldentity.onVerificationFailed Crash error for Android users #368

Open
2 of 8 tasks
cjmisenas-stripe opened this issue Jul 24, 2024 · 8 comments
Open
2 of 8 tasks
Assignees
Labels
question Further information is requested terminal

Comments

@cjmisenas-stripe
Copy link

Platform

  • Web
  • iOS
  • Android

Describe the bug
Seeing a frequent crash happen with the following stack trace for 5.4.2 on Android

Stripeldentity.onVerificationFailed
java.lang.NullPointerException - Attempt to invoke virtual method 'void com.getcapacitor. PluginCall.resolve(com.getcapacitor. JSObject) on a null object reference

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Usage Product
If you adopt this plugin, please let us know which product you are using.

Product Name:
Product URL :
Using Function:

  • Payment Sheet / Payment Flow
  • Apple Pay
  • Google Pay
  • Identity (@capacitor-community/stripe-identity)
  • Terminal(@capacitor-community/stripe-terminal)
@rdlabo
Copy link
Member

rdlabo commented Aug 11, 2024

I checked with Demo and onVerificationFailed did not cause a Crash error. There seems to be another cause. Please give me a small reproduction code or step where the problem occurs.

@rdlabo rdlabo added the question Further information is requested label Aug 11, 2024
@rdlabo
Copy link
Member

rdlabo commented Oct 25, 2024

This Issue is closed due to a long period of inactivity. If you still have issues, please open a new Issue. Best regards.

@rdlabo rdlabo closed this as completed Oct 25, 2024
@yankostadinov
Copy link

@rdlabo
This issue has been causing crashes in our android app continuously for months now.

It seems to be happening because the call variable is null in this file:

call.resolve(new JSObject().put("identityVerificationResult", IdentityVerificationSheetEvent.Failed.getWebEventName()));
}

The call variable is supposed to be setup in thebridge, but there is no saved call.

this.implementation.onVerificationFailed(bridge, identityVerificationCallbackId);

The error seems to happening within the first 5 seconds (as per Crashlytics) of a user's session in our app. So it seems to be a crash happening during initialization of the plugin or when resuming an activity with the plugin, which could help with reproducing it (I haven't been able to do so myself yet).

For what it's worth, we have had reports for users (and session recordings) that indicate this issue could be more common on Motorola devices, although most of the crashlytics reports are on Samsung devices still.

error:

Fatal Exception: java.lang.RuntimeException
Unable to resume activity {***********/**********.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2012565167, result=0, data=null} to activity {*********/********.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.getcapacitor.PluginCall.resolve(com.getcapacitor.JSObject)' on a null object reference

call stack:

android.app.ActivityThread.performResumeActivity (ActivityThread.java:5106)
android.app.ActivityThread.handleResumeActivity (ActivityThread.java:5139)
android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:57)
android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:180)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:98)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2567)
android.os.Handler.dispatchMessage (Handler.java:111)
android.os.Looper.loopOnce (Looper.java:242)
android.os.Looper.loop (Looper.java:362)
android.app.ActivityThread.main (ActivityThread.java:8448)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:552)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:992)

@manpreet-stripe
Copy link

rdlabochecking if you were able to see the above call stack/trace that is causing crashes in android app

@rdlabo
Copy link
Member

rdlabo commented Dec 3, 2024

@yankostadinov Thanks for information. Now we can finally discuss it!

This alone makes me think that IdentityVerificationSheet.Companion is being executed more than once.
Can you check the number of times apps has been executed? (I think the quickest way is to check in the Log)

Also make sure that present() is not mistakenly executed twice.

@rdlabo rdlabo added the terminal label Dec 3, 2024
@rdlabo rdlabo self-assigned this Dec 3, 2024
@rkarroll
Copy link

rkarroll commented Dec 6, 2024

@rdlabo I work with @yankostadinov and we'll get back to you soon!

@Julian-Sam
Copy link

@rdlabo what do you mean by number of times apps has been executed?

@rdlabo
Copy link
Member

rdlabo commented Dec 10, 2024

@Julian-Sam I don't know what the implementation is, but I suspect a double-click-like process.
The best thing to do is to create a repository where the problem can be reproduced and share it with us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested terminal
Projects
None yet
Development

No branches or pull requests

6 participants