为了账号安全,请及时绑定邮箱和手机立即绑定

WKWebView 线程 1:使用位置时发出 SIGABRT 信号

WKWebView 线程 1:使用位置时发出 SIGABRT 信号

慕容708150 2021-11-04 17:52:44
我是 Swift 和 WKWebView 的新手。我在我的应用程序中实现了一个 WKWebView。我想在其中显示一个网站,该网站使用https://www.google.com/maps.我NSLocationWhenInUseUsageDescription在Info.plist.当我第一次打开应用程序时,会出现一个询问位置的提示。当我单击Allow该应用程序时,该应用程序因Thread 1: signal SIGABRT错误而崩溃。我检查了我所有的网点,绝对没有错误。还显示错误:UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!但我没有明确调用 aUIAlertView所以我不知道如何解决这个问题。
查看完整描述

3 回答

?
MM们

TA贡献1886条经验 获得超2个赞

我也是,这很糟糕。


 *** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'

*** First throw call stack:

(

    0   CoreFoundation                      0x00007fff23b98bde __exceptionPreprocess + 350

    1   libobjc.A.dylib                     0x00007fff503b5b20 objc_exception_throw + 48

    2   CoreFoundation                      0x00007fff23b98a1c +[NSException raise:format:] + 188

    3   UIKitCore                           0x00007fff466e9463 -[UIAlertView initWithFrame:] + 417

    4   UIKitCore                           0x00007fff466e9ad0 -[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 218

    5   UIKitCore                           0x00007fff47516acf +[UIAlertView(ViewServiceSupport) _alertViewForWindow:] + 217

    6   UIKitCore                           0x00007fff476cdb44 -[UIWebGeolocationPolicyDecider _executeNextChallenge] + 242

    7   WebKit                              0x00007fff2d123a6d _ZN6WebKit43decidePolicyForGeolocationRequestFromOriginEPN7WebCore14SecurityOriginERKN3WTF6StringEPU37objcproto26WebAllowDenyPolicyListener11objc_objectP8UIWindow + 169

    8   WebKit                              0x00007fff2d123641 -[WKGeolocationProviderIOS(WebGeolocationCoreLocationUpdateListener) geolocationAuthorizationGranted] + 603

    9   WebKit                              0x00007fff2d12328d -[WKGeolocationProviderIOS

...


查看完整回答
反对 回复 2021-11-04
?
浮云间

TA贡献1829条经验 获得超4个赞

我也是,这很糟糕。


 *** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'

*** First throw call stack:

(

    0   CoreFoundation                      0x00007fff23b98bde __exceptionPreprocess + 350

    1   libobjc.A.dylib                     0x00007fff503b5b20 objc_exception_throw + 48

    2   CoreFoundation                      0x00007fff23b98a1c +[NSException raise:format:] + 188

    3   UIKitCore                           0x00007fff466e9463 -[UIAlertView initWithFrame:] + 417

    4   UIKitCore                           0x00007fff466e9ad0 -[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 218

    5   UIKitCore                           0x00007fff47516acf +[UIAlertView(ViewServiceSupport) _alertViewForWindow:] + 217

    6   UIKitCore                           0x00007fff476cdb44 -[UIWebGeolocationPolicyDecider _executeNextChallenge] + 242

    7   WebKit                              0x00007fff2d123a6d _ZN6WebKit43decidePolicyForGeolocationRequestFromOriginEPN7WebCore14SecurityOriginERKN3WTF6StringEPU37objcproto26WebAllowDenyPolicyListener11objc_objectP8UIWindow + 169

    8   WebKit                              0x00007fff2d123641 -[WKGeolocationProviderIOS(WebGeolocationCoreLocationUpdateListener) geolocationAuthorizationGranted] + 603

    9   WebKit                              0x00007fff2d12328d -[WKGeolocationProviderIOS

...


查看完整回答
反对 回复 2021-11-04
?
阿波罗的战车

TA贡献1862条经验 获得超6个赞

有趣的是,您没有在“始终定位”描述中收到此错误。但你永远找不到位置...

我已将我的应用程序降级到目标平台“iOS 12”而不是 13,然后允许第二个“警报”WKWebView使用位置数据。我无法工作,如何提供一个UIAlertControl代替UIAlertViewWKWebView是要求。

网上有很多人抱怨 iOS 13 中的更新,以及有多少框架和库受到这些变化的影响。


查看完整回答
反对 回复 2021-11-04
  • 3 回答
  • 0 关注
  • 337 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信