WKWebView 在 iOS 14 及更高版本上加载支付 URL 时崩溃

问题描述

我的应用在 WKWebView 上加载 3DS 安全 URL 时崩溃。似乎是 JavaScriptCore 或 libC++abi.dylib 问题。我们只是在 WKWebView 上加载一个 URL,该问题特定于 iOS 14.0 及更高版本,并且在 iOS 13.x 上运行良好。 添加卡详细信息(尤其是 ANZ 卡)后,我们导航到 WKWebView 页面,这是一个 3DS 安全支付页面。应用程序在几秒钟内加载 url 时崩溃,并显示以下消息:

2021-02-16 12:23:09.561862+0530 OrderMealCustomer[3370:81712] -[__NSDictionaryM length]: unrecognized selector sent to instance 0x600002f7a5e0
2021-02-16 12:23:09.932686+0530 OrderMealCustomer[3370:81712] *** Terminating app due to uncaught exception 'NSinvalidargumentexception',reason: '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x600002f7a5e0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e1c8af6 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x000000010e063e78 objc_exception_throw + 48
2 CoreFoundation 0x000000010e1d76f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:]
 + 0
3 CoreFoundation 0x000000010e1cd036 _forwarding_ + 1489
4 CoreFoundation 0x000000010e1cf068 _CF_forwarding_prep_0 + 120
5 JavaScriptCore 0x000000011b3800ac _ZN3WTF6StringC2EP8Nsstring + 60
6 WebCore 0x000000011beb6637 _ZN7WebCore28getDefaultWebCryptoMasterKeyERN3WTF6VectorIhLm0ENS0_15CrashOnOverflowELm16ENS0_10FastMallocEEE + 839
7 WebKit 0x0000000125a84039 _ZN6WebKit15NavigationState16NavigationClient18webCryptoMasterKeyERNS_12WebPageProxyE + 65
8 WebKit 0x0000000125b3274b _ZN6WebKit12WebPageProxy13wrapCryptoKeyERKN3WTF6VectorIhLm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEEONS1_17CompletionHandlerIFvbOS5_EEE + 111
9 WebKit 0x0000000125e0e946 _ZN6WebKit12WebPageProxy21didReceiveSyncmessageERN3IPC10ConnectionERNS1_7DecoderERNSt3__110unique_ptrINS1_7EncoderENS6_14default_deleteIS8_EEEE + 1972
10 WebKit 0x000000012581863c _ZN3IPC18MessageReceiverMap19dispatchSyncmessageERNS_10ConnectionERNS_7DecoderERNSt3__110unique_ptrINS_7EncoderENS5_14default_deleteIS7_EEEE + 138
11 WebKit 0x0000000125b4df8c _ZN6WebKit15WebProcessproxy21didReceiveSyncmessageERN3IPC10ConnectionERNS1_7DecoderERNSt3__110unique_ptrINS1_7EncoderENS6_14default_deleteIS8_EEEE + 32
12 WebKit 0x00000001257f8c65 _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 755
13 WebKit 0x00000001257f9ddd _ZN3WTF6Detail15CallableWrapperIZN3IPC10Connection16SyncmessageState22processIncomingMessageERS3_RNSt3__110unique_ptrINS2_7DecoderENS6_14default_deleteIS8_EEEEE3$_1vJEE4callEv + 541
14 JavaScriptCore 0x000000011b37996d _ZN3WTF7RunLoop11performWorkEv + 573
15 JavaScriptCore 0x000000011b37a47a _ZN3WTF7RunLoop11performWorkEPv + 26
16 CoreFoundation 0x000000010e13738a CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
17 CoreFoundation 0x000000010e137282 __CFRunLoopDoSource0 + 180
18 CoreFoundation 0x000000010e136764 __CFRunLoopDoSources0 + 248
19 CoreFoundation 0x000000010e130f2f __CFRunLoopRun + 878
20 CoreFoundation 0x000000010e1306d6 CFRunLoopRunSpecific + 567
21 GraphicsServices 0x0000000118d7bdb3 GSEventRunModal + 139
22 UIKitCore 0x00000001122aacf7 -[UIApplication _run] + 912
23 UIKitCore 0x00000001122afba8 UIApplicationMain + 101
24 libswiftUIKit.dylib 0x000000010f6c45f2 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
25 OrderMealCustomer 0x0000000108061bda $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 122
26 OrderMealCustomer 0x0000000108061b4e $s17OrderMealCustomer11AppDelegateC5$mainyyFZ + 46
27 OrderMealCustomer 0x0000000108064479 main + 41
28 libdyld.dylib 0x000000010f9363e9 start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)