在将 Xcode 升级到 13.0 版本并在设备上使用它重新编译我的应用程序后,我开始收到此异常:
libc++abi:以 NSException dyld4 配置类型的未捕获异常终止:DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/开发人员/库/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“不能同时设置 NSJSONReadingAssumeTopLevelDictionary 和 NSJSONReadingAllowFragments”以 NSException 类型的未捕获异常终止
似乎问题在于topLevelDictionaryAssume
添加了新选项JSONSerialization.ReadingOptions
,仅适用于 ios15。
我试过的:
我检查了所有有 .allowFragments 的地方,并将其替换为 .allowFragments topLevelDictionaryAssume
。它没有帮助。
任何意见,将不胜感激。