-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Fatal Exception: NSInvalidArgumentException
-[razorpay_flutter.RazorpayDelegate onPaymentSuccess:andData:]: unrecognized selector sent to instance 0x1091129a0
0
CoreFoundation
__exceptionPreprocess
4
CoreFoundation
_CF_forwarding_prep_0
5
Razorpay
InternalRazorpay.swift:232
InternalRazorpay.paymentSuccess(str:dictVerification:) + 232
6
Razorpay
RazorpayCheckout+JSBridge.swift:639
RazorpayCheckoutVC.onSuccess(withData:) + 639
7
Razorpay
RazorpayCheckout+JSBridge.swift:75
specialized RazorpayCheckoutVC.userContentController(_:didReceive:) + 75
8
Razorpay
<compiler-generated>
@objc RazorpayCheckoutVC.userContentController(_:didReceive:)
9
WebKit
(Missing UUID 38f840de4cb93015b3cb931934d315b8)
27
UIKitCore
__51-[UIStatusBar_Base _setHidden:animationParameters:]_block_invoke_4
28
Runner
AppDelegate.swift
main
29
(Missing)
Description
My FlutterFlow app integrates razorpay_flutter plugin (version 1.4.0) to accept payments. While the payment portal works fine on Android and iOS emulator, the iOS release build crashes as the payment portal comes up and immediately after payment success with the following fatal error:
Fatal Exception: NSInvalidArgumentException -[razorpay_flutter.RazorpayDelegate onPaymentSuccess:andData:]: unrecognized selector sent to instance
The app also crashes similarly on payment cancellation due to a similar unrecognized selector for onPaymentError:description:andData:.
The issue seems related to native iOS delegate methods not being exposed correctly to Objective-C runtime in the razorpay_flutter plugin for release builds.
On most devices it does not even bring up the payment portal page.
Flutter Version :
Flutter 3.35.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 05db968908 (9 weeks ago) • 2025-08-25 10:21:35 -0700
Engine • hash abb725c9a5211af2a862b83f74b7eaf2652db083 (revision a8bfdfc394) (2 months ago) • 2025-08-22 23:51:12.000Z
Tools • Dart 3.9.0 • DevTools 2.48.0
Xcode Version :
Xcode Version: Not installed / No access to Xcode (FlutterFlow only)
Cocoapod Version :
Cocoapods:
- razorpay-pod: 1.4.0 (from Podfile.lock)
- Flutter plugin razorpay_flutter: 1.4.0
- iOS Deployment Target: 14.0 (from Podfile)
Steps To Reproduce
- Run app on iOS device in release mode (not emulator)
- Launch Razorpay payment portal and complete payment
- Observe immediate app crash with unrecognized selector exception after payment callback
Expected Results
- Payment portal opens successfully on iOS release build without crashing
- onPaymentSuccess and onPaymentError callbacks are received normally in release mode
Crashlytics Logs
Fatal Exception: NSInvalidArgumentException
-[razorpay_flutter.RazorpayDelegate onPaymentSuccess:andData:]: unrecognized selector sent to instance 0x1091129a0
(Full log attached as com.zakoop.enterprise.app_issue_f6602bcdc5ac71e2a3a4280b43758b86_crash_session_149900abfb99448ca47786ad55a9d5d4_DNE_0_v2_stacktrace.txt)
Snack, code example, screenshot, or link to a repository:
- Using FlutterFlow UI builder with razorpay_flutter plugin 1.4.0
- Full native stack trace attached for reference