WKWebview 在 使用XCode11 iOS12 引發的慘案

GorgoasTW
2 min readFeb 11, 2020

--

目前專案的專案開發進度到一定的程度,開始使用不同的版本測試時

只要在iOS13以下且頁面有使用到 WkWebview 就會發生如下的錯誤,並且閃退

libc++abi.dylib: terminating with uncaught exception of type NSExceptionTerminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named WKWebView because no class named WKWebView was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)'

在研究提示訊息後發現是缺少了WebKit.framework。

使用 iOS13+ 的設備 WKWebview 不會發生問題,但是iOS13以下的設備就會閃退

如下圖新增 framework 之後就正常了

--

--

GorgoasTW
GorgoasTW

Written by GorgoasTW

iOS Developer/.NET Developer/Father

No responses yet