Swift3.0中的Realm异常状态码:-34018



运行此代码

SyncUser.authenticate(with: Credential.usernamePassword(username: username, password: password, actions: [.useExistingAccount]), server: Constants.syncAuthURL) { (user, error) in }

返回-34018错误码

libc++abi.dylib: terminating with uncaught exception of type realm::keychain::KeychainAccessException: Keychain returned unexpected status code: -34018

断点

_dispatch_once(dispatch_once_t *predicate,
    DISPATCH_NOESCAPE dispatch_block_t block){
if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) {
    dispatch_once(predicate, block);
} else {
    dispatch_compiler_barrier();
}
DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l);}

THX

-34018表示errSecMissingEntitlement。尝试指定一个授权文件,即使它不包含任何授权,也可以解决这个问题。

查看更多信息:https://github.com/realm/realm-cocoa/issues/4158

最新更新