ios - 当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常
<p><p>当 Ionic 3 应用在大于 9.3 的 ios 上运行但 9.3 或更低版本正常时,Xcode 会给出异常,为什么?</p>
<p>给出这个痕迹:</p>
<pre class="lang-none prettyprint-override"><code>2018-05-04 10:12:51.442622+0500 AfroCoin 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: 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 Apache Cordova native platform version 4.5.3 is starting.
2018-05-04 10:13:03.637288+0500 AfroCoin Multi-tasking -> Device: YES, App: YES
2018-05-04 10:13:03.777136+0500 AfroCoin CDVWKWebViewEngine: trying to inject XHR polyfill
2018-05-04 10:13:04.034624+0500 AfroCoin *** 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 - + 9
3 Foundation 0x000000010a0bfb47 - + 292
4 AfroCoin 0x000000010926df46 __43+_block_invoke + 358
5 AfroCoin 0x0000000109285667 - + 983
6 AfroCoin 0x00000001092d13ab - + 315
7 AfroCoin 0x00000001092d0abc - + 1404
8 AfroCoin 0x00000001092d0fc2 - + 354
9 AfroCoin 0x00000001092ce516 - + 566
10AfroCoin 0x000000010926c196 - + 54
11UIKit 0x000000010f59b191 - + 1215
12UIKit 0x000000010f59b5d4 - + 27
13UIKit 0x000000010f469183 - + 122
14UIKit 0x000000010f469894 - + 294
15UIKit 0x000000012805a136 - + 86
16UIKit 0x000000010f47c62c - + 42
17AfroCoin 0x00000001092d2e08 - + 776
18AfroCoin 0x000000010926bf17 - + 199
19UIKit 0x000000010f3ee75b - + 278
20UIKit 0x000000010f3f01d2 - + 4123
21UIKit 0x000000010f3f562b - + 1677
22UIKit 0x000000010f7b7e4a _111-_block_invoke + 866
23UIKit 0x000000010fb8a909 + + 153
24UIKit 0x000000010f7b7a86 - + 236
25UIKit 0x000000010f7b82a7 - + 675
26UIKit 0x00000001101294d4 _82-_block_invoke + 299
27UIKit 0x000000011012936e - + 433
28UIKit 0x000000010fe0d62d __125-_block_invoke + 221
29UIKit 0x0000000110008387 _performActionsWithDelayForTransitionContext + 100
30UIKit 0x000000010fe0d4f7 - + 223
31UIKit 0x000000010fb89fb0 - + 392
32UIKit 0x000000010f3f3f0c - + 515
33UIKit 0x000000010f9c6a97 - + 361
34FrontBoardServices 0x00000001184402f3 - + 331
35FrontBoardServices 0x0000000118448cfa __56-_block_invoke_2 + 225
36libdispatch.dylib 0x000000010d5b8848 _dispatch_client_callout + 8
37libdispatch.dylib 0x000000010d5bde14 _dispatch_block_invoke_direct + 592
38FrontBoardServices 0x0000000118474470 _FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK_ + 24
39FrontBoardServices 0x000000011847412e - + 439
40FrontBoardServices 0x000000011847468e - + 45
41CoreFoundation 0x000000010c261bb1 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17
42CoreFoundation 0x000000010c2464af __CFRunLoopDoSources0 + 271
43CoreFoundation 0x000000010c245a6f __CFRunLoopRun + 1263
44CoreFoundation 0x000000010c24530b CFRunLoopRunSpecific + 635
45GraphicsServices 0x000000010e1eba73 GSEventRunModal + 62
46UIKit 0x000000010f3f70b7 UIApplicationMain + 159
47AfroCoin 0x000000010926be31 main + 65
48libdyld.dylib 0x000000010d635955 start + 1
49??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>根据我的经验,您需要将您的 <code>cordova</code> 版本更新为旧版本的 <code>cordova</code>。</p>
<p>作为 iOS 9.0 之后不推荐使用的方法,因此您需要从该键中删除 _ (<code>_requiresUserActionForMediaPlayback</code>) 或更新您的 <code>cordova cli</code> </p>
<p><strong>更新cordova cmd:</strong></p>
<pre><code>$ sudo npm update -g cordova
</code></pre>
<p>通过更新到最新的 Cordova CLI 将解决您的崩溃问题。</p>
<p>有关更多引用,您可以在 GitHub 上找到以下报告的问题:</p>
<p><strong>问题链接</strong>:<a href="https://github.com/katzer/cordova-plugin-background-mode/issues/264" rel="noreferrer noopener nofollow">https://github.com/katzer/cordova-plugin-background-mode/issues/264</a> </p>
<p>希望这会有所帮助。</p></p>
<p style="font-size: 20px;">关于ios - 当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/50167865/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/50167865/
</a>
</p>
页:
[1]