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

The app crashes when the payment button is clicked on Android 13 (Oppo device) and this issue occurs in the production build. #416

Open
jerrypaulsam opened this issue Oct 16, 2024 · 7 comments

Comments

@jerrypaulsam
Copy link

jerrypaulsam commented Oct 16, 2024

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

The Android app crashes when users click on the payment button; instead of opening the Razorpay screen, the app crashes. Below is crash report.

Type: java.lang.RuntimeException

Exception java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3864) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4006) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:111) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2462) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:240) at android.os.Looper.loop (Looper.java:351) at android.app.ActivityThread.main (ActivityThread.java:8377) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013) Caused by java.lang.StringIndexOutOfBoundsException: begin 0, end 8, length 4 at java.lang.String.checkBoundsBeginEnd (String.java:4500) at java.lang.String.substring (String.java:2527) at com.razorpay.AnalyticsUtil.getKeyType at com.razorpay.AnalyticsUtil.setAppDetails at com.razorpay.AnalyticsUtil.setup at com.razorpay.CheckoutPresenterImpl.setOptions at com.razorpay.B$$W$.onCreate at com.razorpay.BaseCheckoutOtpelfActivity.onCreate at com.razorpay.CheckoutActivity.onCreate at android.app.Activity.performCreate (Activity.java:8397) at android.app.Activity.performCreate (Activity.java:8370) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1403) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3837)

Flutter Version :

Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-IN)

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. install the latest version of flutter razorpay package
  2. Use an Oppo device with Android 13
  3. App crashes while clicking on payment button.

Expected Results

Instead of crash, it should have opened the razorpay payment page.

Snack, code example, screenshot, or link to a repository:

@vivekshindhe
Copy link
Contributor

hey @jerrypaulsam , is this reproducible by you? if so, could please share the payload you are using? Is this happening 100% of the time? If not, could you please share the frequency rate for this issue to occur?

@jerrypaulsam
Copy link
Author

Hello @vivekshindhe,
We received complaints from customers that devices were crashing when they click the payment button, as per the logs from crash report, it is happening with Oppo Android 13 and similar devices.

This is the payload:
var options = {
'key': razKeyId.toString(),
'amount': (orderTotal != null)
? orderTotal!.toString()
: checkedOutItems!.total.toString(),
"currency": "INR",
"order_id": razOrderId,
'name': 'XXX',
'description': "Order ID: $payMentOrderID",
// 'customer_id': "cust-$userEmail",
"readonly": { 'email': true, 'contact': true},
'prefill': {
'contact': userMobile,
'email': userEmail
}
};

@jerrypaulsam
Copy link
Author

any update?

@vivekshindhe
Copy link
Contributor

vivekshindhe commented Oct 22, 2024

@jerrypaulsam hey, unable to reproduce this on my end with various combinations. Do you have the order_ids or any identifying parameter that you would send in notes for us to look at the logs?

Adding to the above, is this happening only on one device family and one android version? Oppo ; android 13? Have you tried with other devices? From the crash logs we can see that the issue is happening because of the apiKey, but since it's working on other devices not sure what the difference is.

@jerrypaulsam
Copy link
Author

Hello,

Yes, it is working with other devices. Having trouble with another Oppo device as well. This is one of the order id - 1728916236886762.

It happens in the production build.

@vivekshindhe
Copy link
Contributor

@jerrypaulsam just to clarify the string you attached in the previous message, is that present in the payload in the description key?

@jerrypaulsam
Copy link
Author

Yes.

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