【问题标题】:Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: deleting current dictionary由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:删除当前字典
【发布时间】:2017-12-19 08:48:11
【问题描述】:

当我尝试在 Xcode 8.1 中运行项目时,我遇到了以下错误(请参阅日志)。我清理了代码并重置了模拟器,但没有奏效。

** Assertion failure in -[KeychainItemWrapper resetKeychainItem], /Users/manishpathak/iosProjects/MyProject/MyProject/KeychainItemWrapper.m:202
2017-07-14 15:09:09.521 MyProject[26741:3318830] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Problem deleting current dictionary.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001054ba34b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x0000000104f1b21e objc_exception_throw + 48
    2   CoreFoundation                      0x00000001054be442 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x0000000104ab1e4d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   AppifyViewer                        0x000000010278b542 -[KeychainItemWrapper resetKeychainItem] + 2354
    5   AppifyViewer                        0x0000000102713494 +[MDXKeychain storeToKeychain:withPassword:] + 292
    6   AppifyViewer                        0x00000001027b3a59 -[MDXSecurityPolicy saveCredential:] + 281
    7   AppifyViewer                        0x0000000102718f37 __32-[MDXLoginViewController login:]_block_invoke + 407
    8   AppifyViewer                        0x000000010285ed19 __76-[RXPromise registerWithExecutionContext:onSuccess:onFailure:returnPromise:]_block_invoke_3 + 89
    9   libdispatch.dylib                   0x0000000108140980 _dispatch_call_block_and_release + 12
    10  libdispatch.dylib                   0x000000010816a0cd _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x000000010814a8d6 _dispatch_main_queue_callback_4CF + 406
    12  CoreFoundation                      0x000000010547e4f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    13  CoreFoundation                      0x0000000105443f8d __CFRunLoopRun + 2205
    14  CoreFoundation                      0x0000000105443494 CFRunLoopRunSpecific + 420
    15  GraphicsServices                    0x0000000109faba6f GSEventRunModal + 161
    16  UIKit                               0x00000001067df964 UIApplicationMain + 159
    17  AppifyViewer                        0x00000001027a4857 main + 231
    18  libdyld.dylib                       0x00000001081b668d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

【问题讨论】:

  • Show the breakpoint navigator 中单击左下角的+ 按钮,然后添加Exception Breakpoint。运行应用程序并检查哪行代码产生了异常。
  • 您的代码(或您已包含在项目中的某些代码)在KeychainItemWrapper 的第 202 行引发了异常 - 查看该代码并找出它在抱怨什么

标签: ios xcode ios9 xcode8.1


【解决方案1】:

解决方案

开启 KeyChain 共享后即可使用。

启用钥匙串共享

1- 点击项目的Target

2- 点击标签Capabilities 并搜索Keychain sharing

3- 启用Keychain sharing

【讨论】:

    猜你喜欢
    • 2014-01-05
    • 1970-01-01
    • 2012-07-28
    • 2015-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多