猿问

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

我是 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所以我不知道如何解决这个问题。


慕容708150
浏览 338回答 3
3回答

MM们

我也是,这很糟糕。 *** 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...

浮云间

我也是,这很糟糕。 *** 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...

阿波罗的战车

有趣的是,您没有在“始终定位”描述中收到此错误。但你永远找不到位置...我已将我的应用程序降级到目标平台“iOS 12”而不是 13,然后允许第二个“警报”WKWebView使用位置数据。我无法工作,如何提供一个UIAlertControl代替UIAlertView的WKWebView是要求。网上有很多人抱怨 iOS 13 中的更新,以及有多少框架和库受到这些变化的影响。
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答