OStack程序员社区-中国程序员成长平台

标题: ios - 当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 14:39
标题: ios - 当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常

当 Ionic 3 应用在大于 9.3 的 ios 上运行但 9.3 或更低版本正常时,Xcode 会给出异常,为什么?

给出这个痕迹:

2018-05-04 10:12:51.442622+0500 AfroCoin[3018:45327] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/ApplePro/Library/Developer/CoreSimulator/Devices/13045814-2612-45C9-B223-CFC9C7F84987/data/Containers/Data/Application/5E794874-59EA-4DF6-B824-82B97E52E402/Library/Cookies/io.ionic.afrocoinworldwide.binarycookies
objc[3018]: Class VCWeakObjectHolder is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/Frameworks/ViceroyTrace.framework/ViceroyTrace (0x1299384d0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AVConference.framework/AVConference (0x128a64e38). One of the two will be used. Which one is undefined.
2018-05-04 10:13:03.634193+0500 AfroCoin[3018:45327] Apache Cordova native platform version 4.5.3 is starting.
2018-05-04 10:13:03.637288+0500 AfroCoin[3018:45327] Multi-tasking -> Device: YES, App: YES
2018-05-04 10:13:03.777136+0500 AfroCoin[3018:45327] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-05-04 10:13:04.034624+0500 AfroCoin[3018:45327] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x7fc776d138a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _requiresUserActionForMediaPlayback.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010c2bf1e6 __exceptionPreprocess + 294
    1   libobjc.A.dylib                     0x000000010a69e031 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010c2bf0b9 -[NSException raise] + 9
    3   Foundation                          0x000000010a0bfb47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
    4   AfroCoin                            0x000000010926df46 __43+[APPBackgroundMode swizzleWKWebViewEngine]_block_invoke + 358
    5   AfroCoin                            0x0000000109285667 -[CDVWKWebViewEngine pluginInitialize] + 983
    6   AfroCoin                            0x00000001092d13ab -[CDVViewController registerPlugin:withClassName:] + 315
    7   AfroCoin                            0x00000001092d0abc -[CDVViewController newCordovaViewWithFrame:] + 1404
    8   AfroCoin                            0x00000001092d0fc2 -[CDVViewController createGapView] + 354
    9   AfroCoin                            0x00000001092ce516 -[CDVViewController viewDidLoad] + 566
    10  AfroCoin                            0x000000010926c196 -[MainViewController viewDidLoad] + 54
    11  UIKit                               0x000000010f59b191 -[UIViewController loadViewIfRequired] + 1215
    12  UIKit                               0x000000010f59b5d4 -[UIViewController view] + 27
    13  UIKit                               0x000000010f469183 -[UIWindow addRootViewControllerViewIfPossible] + 122
    14  UIKit                               0x000000010f469894 -[UIWindow _setHidden:forced:] + 294
    15  UIKit                               0x000000012805a136 -[UIWindowAccessibility _orderFrontWithoutMakingKey] + 86
    16  UIKit                               0x000000010f47c62c -[UIWindow makeKeyAndVisible] + 42
    17  AfroCoin                            0x00000001092d2e08 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 776
    18  AfroCoin                            0x000000010926bf17 -[AppDelegate application:didFinishLaunchingWithOptions:] + 199
    19  UIKit                               0x000000010f3ee75b -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 278
    20  UIKit                               0x000000010f3f01d2 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4123
    21  UIKit                               0x000000010f3f562b -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
    22  UIKit                               0x000000010f7b7e4a _111-[__UICanvasLifecycleMonitor_Compatability scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
    23  UIKit                               0x000000010fb8a909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    24  UIKit                               0x000000010f7b7a86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    25  UIKit                               0x000000010f7b82a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
    26  UIKit                               0x00000001101294d4 _82-[_UIApplicationCanvas transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
    27  UIKit                               0x000000011012936e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
    28  UIKit                               0x000000010fe0d62d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
    29  UIKit                               0x0000000110008387 _performActionsWithDelayForTransitionContext + 100
    30  UIKit                               0x000000010fe0d4f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
    31  UIKit                               0x000000010fb89fb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    32  UIKit                               0x000000010f3f3f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
    33  UIKit                               0x000000010f9c6a97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    34  FrontBoardServices                  0x00000001184402f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
    35  FrontBoardServices                  0x0000000118448cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
    36  libdispatch.dylib                   0x000000010d5b8848 _dispatch_client_callout + 8
    37  libdispatch.dylib                   0x000000010d5bde14 _dispatch_block_invoke_direct + 592
    38  FrontBoardServices                  0x0000000118474470 _FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK_ + 24
    39  FrontBoardServices                  0x000000011847412e -[FBSSerialQueue _performNext] + 439
    40  FrontBoardServices                  0x000000011847468e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    41  CoreFoundation                      0x000000010c261bb1 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17
    42  CoreFoundation                      0x000000010c2464af __CFRunLoopDoSources0 + 271
    43  CoreFoundation                      0x000000010c245a6f __CFRunLoopRun + 1263
    44  CoreFoundation                      0x000000010c24530b CFRunLoopRunSpecific + 635
    45  GraphicsServices                    0x000000010e1eba73 GSEventRunModal + 62
    46  UIKit                               0x000000010f3f70b7 UIApplicationMain + 159
    47  AfroCoin                            0x000000010926be31 main + 65
    48  libdyld.dylib                       0x000000010d635955 start + 1
    49  ???                                 0x0000000000000001 0x0 + 1
)

libc++abi.dylib: terminating with uncaught exception of type NSException



Best Answer-推荐答案


根据我的经验,您需要将您的 cordova 版本更新为旧版本的 cordova

作为 iOS 9.0 之后不推荐使用的方法,因此您需要从该键中删除 _ (_requiresUserActionForMediaPlayback) 或更新您的 cordova cli

更新cordova cmd:

$ sudo npm update -g cordova

通过更新到最新的 Cordova CLI 将解决您的崩溃问题。

有关更多引用,您可以在 GitHub 上找到以下报告的问题:

问题链接:https://github.com/katzer/cordova-plugin-background-mode/issues/264

希望这会有所帮助。

关于ios - 当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50167865/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4