razorpay / react-native-razorpay

React Native wrapper for Razorpay's mobile SDKs
https://www.npmjs.com/package/react-native-razorpay
MIT License
122 stars 107 forks source link

Android : App crashing after payment success callback is called #330

Closed jitunayak closed 3 years ago

jitunayak commented 3 years ago

Hi Team,

I am running on MacOS 11.2.3. For me ios builds are running fine. But android build is crashing just after returning from the payment page. I get the payment token on successful callback. Then it crashes the whole app. Below is android adb log.

React-native side configuration

 macOS : 11.2.3
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-razorpay": "^2.2.4",

Android side configuration

 buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"

 ./gradlew --version

------------------------------------------------------------
Gradle 6.7
------------------------------------------------------------

Build time:   2020-10-14 16:13:12 UTC
Revision:     312ba9e0f4f8a02d01854d1ed743b79ed996dfd3

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.10 (AdoptOpenJDK 11.0.10+9)
OS:           Mac OS X 10.16 x86_64

ADB Log Error

05-05 22:49:56.006 29312 29312 D com.razorpay.checkout: Sending data to lumberjack
05-05 22:49:56.031 29312 29312 D AndroidRuntime: Shutting down VM
05-05 22:49:56.031 29312 29312 E AndroidRuntime: FATAL EXCEPTION: main
05-05 22:49:56.031 29312 29312 E AndroidRuntime: Process: com.paymentdemo, PID: 29312
05-05 22:49:56.031 29312 29312 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=62442, result=1, data=Intent { (has extras) }} to activity {com.paymentdemo/com.paymentdemo.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])' on a null object reference

05-05 22:49:56.038 29312 29555 D com.razorpay.checkout: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=62442, result=1, data=Intent { (has extras) }} to activity {com.paymentdemo/com.paymentdemo.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])' on a null object reference
05-05 22:49:56.038 29312 29555 D com.razorpay.checkout:     at android.app.ActivityThread.deliverResults(ActivityThread.java:5015)
vivekshindhe commented 3 years ago

@jitunayak Thanks for reaching out to us. Just tested this, wasn't able to reproduce the issue on my end. Will need more information for this, the payload that you are sending, and if possible a sample app where you are able to reproduce this issue. This would help us resolving this issue in a quick turnaround time. Thank you.

jitunayak commented 3 years ago

@vivekshindhe I have created a git repo to test the app:

https://github.com/jitunayak/PaymentDemo

I have tried with UPI method. (e.g success@razorpay)

vivekshindhe commented 3 years ago

@jitunayak Thanks for the sample app. It helped put a lot of things in perspective. I saw you also use a library called 'react-native-upi-payment'. It looks like when the success response is called, it also gets called there due to unknown reasons. It works fine without that particular library. Also, Razorpay provides support for UPI payments. You could probably go this way.

vivekshindhe commented 3 years ago

Closing this ticket. Please feel free to create another ticket for support. Thank you.

Rohan-Rajesh commented 3 years ago

Hi,

I am getting the same error and it works when I remove the react-native-upi-payment library, for my app I need the functionality that this library provides i.e. payment through upi app with UPI intent, I saw that in razorpay the only option is to enter the UPI id to make payments, is there any way I can either open a UPI app directly from razorpay or solve the issue by removing the clash between the 2 libraries

Thanks