razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
108 stars 149 forks source link

E/com.razorpay.checkout(30594): Webview JS Error: Uncaught (in promise) #<Object> #399

Closed omegaui closed 3 months ago

omegaui commented 3 months ago

Unable to do payment on android with the razorpay flutter sdk, an unknown runtime webview exception is thrown, attached below:

E/com.razorpay.checkout(30594): Webview JS Error: Uncaught (in promise) #<Object>
I/chromium(30594): [INFO:CONSOLE(0)] "Uncaught (in promise) #<Object>", source: https://api.razorpay.com/v1/checkout/public?version=1.6.40&library=checkoutjs&platform=android&country_code=IN&session_token=MY_SESSION_TOKEN&traffic_env=production (0)

The same payment is working on iOS though, seems like an issue with webview inside the Razorpay SDK for android.

This is the screen below, it shows up whenever I initiate any payment in my app:

image

Here's my flutter doctor output in verbose mode:

flutter doctor -v
[✓] Flutter (Channel stable, 3.13.7, on Ubuntu 24.04 LTS 6.8.0-40-generic, locale en_US.UTF-8)
    • Flutter version 3.13.7 on channel stable at /home/omegaui/dev/tools/flutter-3.13.7
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2f708eb839 (10 months ago), 2023-10-09 09:58:08 -0500
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /home/omegaui/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu224.04)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/google-chrome-stable

[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from
      https://github.com/ninja-build/ninja/releases
    ✗ pkg-config is required for Linux development.
      It is likely available from your distribution (e.g.: apt install pkg-config), or can be downloaded from
      https://www.freedesktop.org/wiki/Software/pkg-config/

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2024.1)
    • IntelliJ at /home/omegaui/dev/apps/intellij
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.92.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.94.0

[✓] Connected device (3 available)
    • SM E236B (mobile) • RZCT40NXK8Y • android-arm64  • Android 14 (API 34)
    • Linux (desktop)   • linux       • linux-x64      • Ubuntu 24.04 LTS 6.8.0-40-generic
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 127.0.6533.99

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.

Please help us resolve this issue, the app is in production, this issue came all of a sudden.

vivekshindhe commented 3 months ago

@omegaui do you get any error callback when you see this error? If possible can you please share a couple of order_ids on which this has happened?

omegaui commented 3 months ago

@vivekshindhe The handlePaymentError callback doesn't get called. Here's the order id that I tried just now order_OjskmYqpNhmi9Z.

wrteam-vimal commented 3 months ago

Same issue here

omegaui commented 3 months ago
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.razorpay:checkout:1.6.+.
     Required by:
         project :app > project :razorpay_flutter
      > Failed to list versions for com.razorpay:checkout.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/razorpay/checkout/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/com/razorpay/checkout/maven-metadata.xml'. Received status code 500 from server: Internal Server Error

@vivekshindhe Please take a look at this, the app is not compiling anymore, there's something wrong with the razorpay maven bintray, also the other issue mentioned in the start, it also look like something wrong with the razorpay server.

I tried running previous versions also: 1.3.2, 1.3.6, even the latest 1.3.7 fails to compile.

kumarkrati commented 3 months ago

Same issue, happening on our prod app. Please give us a solution!

omegaui commented 3 months ago

I'm able to compile it now. But still unable to do payments. @razorpay

omegaui commented 3 months ago

Fixed now.