WKWebView 在 iOS 14 中崩溃

问题描述

WKWebView 在从 URL 加载内容时使应用程序崩溃。这是一个适用于 iOS

2021-02-22 16:10:53.366952+0530 OrderMealCustomer[6826:326746] -[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000125e6a0
2021-02-22 16:10:53.586212+0530 OrderMealCustomer[6826:326746] *** Terminating app due to uncaught exception 'NSinvalidargumentexception',reason: '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000125e6a0'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000113784af6 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x0000000113e2fe78 objc_exception_throw + 48
    2   CoreFoundation                      0x00000001137936f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
    3   CoreFoundation                      0x0000000113789036 ___forwarding___ + 1489
    4   CoreFoundation                      0x000000011378b068 _CF_forwarding_prep_0 + 120
    5   JavaScriptCore                      0x0000000112ede0ac _ZN3WTF6StringC2EP8Nsstring + 60
    6   WebCore                             0x000000011fd5a637 _ZN7WebCore28getDefaultWebCryptoMasterKeyERN3WTF6VectorIhLm0ENS0_15CrashOnOverflowELm16ENS0_10FastMallocEEE + 839
    7   WebKit                              0x0000000110fd4039 _ZN6WebKit15NavigationState16NavigationClient18webCryptoMasterKeyERNS_12WebPageProxyE + 65
    8   WebKit                              0x000000011108274b _ZN6WebKit12WebPageProxy13wrapCryptoKeyERKN3WTF6VectorIhLm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEEONS1_17CompletionHandlerIFvbOS5_EEE + 111
    9   WebKit                              0x000000011135e946 _ZN6WebKit12WebPageProxy21didReceiveSyncmessageERN3IPC10ConnectionERNS1_7DecoderERNSt3__110unique_ptrINS1_7EncoderENS6_14default_deleteIS8_EEEE + 1972
    10  WebKit                              0x0000000110d6863c _ZN3IPC18MessageReceiverMap19dispatchSyncmessageERNS_10ConnectionERNS_7DecoderERNSt3__110unique_ptrINS_7EncoderENS5_14default_deleteIS7_EEEE + 138
    11  WebKit                              0x000000011109df8c _ZN6WebKit15WebProcessproxy21didReceiveSyncmessageERN3IPC10ConnectionERNS1_7DecoderERNSt3__110unique_ptrINS1_7EncoderENS6_14default_deleteIS8_EEEE + 32
    12  WebKit                              0x0000000110d48c65 _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 755
    13  WebKit                              0x0000000110d49ddd _ZN3WTF6Detail15CallableWrapperIZN3IPC10Connection16SyncmessageState22processIncomingMessageERS3_RNSt3__110unique_ptrINS2_7DecoderENS6_14default_deleteIS8_EEEEE3$_1vJEE4callEv + 541
    14  JavaScriptCore                      0x0000000112ed796d _ZN3WTF7RunLoop11performWorkEv + 573
    15  JavaScriptCore                      0x0000000112ed847a _ZN3WTF7RunLoop11performWorkEPv + 26
    16  CoreFoundation                      0x00000001136f338a __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    17  CoreFoundation                      0x00000001136f3282 __CFRunLoopDoSource0 + 180
    18  CoreFoundation                      0x00000001136f2764 __CFRunLoopDoSources0 + 248
    19  CoreFoundation                      0x00000001136ecf2f __CFRunLoopRun + 878
    20  CoreFoundation                      0x00000001136ec6d6 CFRunLoopRunSpecific + 567
    21  GraphicsServices                    0x000000011e364db3 GSEventRunModal + 139
    22  UIKitCore                           0x0000000117893cf7 -[UIApplication _run] + 912
    23  UIKitCore                           0x0000000117898ba8 UIApplicationMain + 101
    24  libswiftUIKit.dylib                 0x0000000114cad5f2 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
    25  OrderMealCustomer                   0x000000010acfbcfa $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 122
    26  OrderMealCustomer                   0x000000010acfbc6e $s17OrderMealCustomer11AppDelegateC5$mainyyFZ + 46
    27  OrderMealCustomer                   0x000000010acfe599 main + 41
    28  libdyld.dylib                       0x0000000114f1f3e9 start + 1
    29  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSinvalidargumentexception',reason: '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000125e6a0'

可能是因为内容中有斜杠(/)。

该问题特定于 iOS 14.x。

解决方法

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

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

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