Describe the issue
Terminating app due to uncaught exception ‘NSInvalidArgumentException’.
when I hit the Apple Pay Button I got this issue.
787406+0530 Runner[6770:338808] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument’
*** First throw call stack:
(0x1a718edb4 0x1a56199a0 0x1a653e4bc 0x1a653e380 0x104c1cda0 0x104c13f38 0x104c1e860 0x108ca0b14 0x10878ba8c 0x10511408c 0x1051158c4 0x105124428 0x105124080 0x1a7218ac8 0x1a71fc754 0x1a7200dfc 0x1e10b6984 0x1ae3e3e7c 0x1ae3e3af4 0x102da4d34 0x1c88bede0)
Steps to reproduce the issue.
Added latest version of SDK.
- flutter pubspec.yaml : square_in_app_payments: ^1.7.5
- initialize Apple Pay
- call `await InAppPayments.requestApplePayNonce(…)
Here the piece of code that reproduce the issue.
InAppPayments.requestApplePayNonce(
price: "1.0",
currencyCode: "USD",
countryCode: 'US',
summaryLabel: 'Cookie',
paymentType: ApplePayPaymentType.finalPayment,
onApplePayComplete: _onApplePayEntryComplete,
onApplePayNonceRequestSuccess: _onApplePayNonceRequestSuccess,
onApplePayNonceRequestFailure: _onApplePayNonceRequestFailure,
);
already posted same on stack overflow : flutter - Square Apple Pay Integration: Terminating app due to uncaught exception 'NSInvalidArgumentException' - Stack Overflow
My app get crashed, I’m running in iPhoneX with iOS 16. please provide the solution as soon as possible.