ios - 由于 Spotify 问题,应用程序在启动时崩溃

标签 ios iphone spotify cocoalibspotify-2.0

我们正在开发一个项目,从 Spotify 获取源。我们在其中集成了 Spotify 库。由于应用程序启动崩溃问题,该应用程序被 MFI 审批流程拒绝。我们被困在这里了。这确实很紧急,我们感谢您的快速帮助。

应用程序启动时,我们收到应用程序崩溃错误。我们正在调用一个方法,这可能是崩溃的原因,但我们不确定。

- (void)clearKeychain {
  for( NSString *serviceName in @[@"rdio",@"spotify",@"spotifyUsername",@"muzik"]) {
    DDLogVerbose(@"removing keychain entry for service = %@", serviceName);
    [MZUserManager removeTokenForService:serviceName];
  }

MZSpotifyService *spotify = (MZSpotifyService*)[[MZDataManager sharedManager] serviceWithName:[MZSpotifyService shortName]];
  [spotify.sessionManager logout];

  [MZRdioService rdio].delegate = nil;
  [[MZRdioService rdio] logout];
}

---------------------------------

- (MZBaseService *)serviceWithName:(NSString *)serviceName
{
    NSLog(@"active services : \n %@",_activeServices);
  return _activeServices[serviceName];
}

---------------------------------------

- (void)logout {
  [[SPSession sharedSession] logout:^{
    DDLogVerbose(@"logged out from spotify");
  }];
}

下面是日志

2013-10-31 15:43:54 -0700 muzik[297] <Warning> *** Assertion failure in NSString* base::deviceIdFromKeychain()(), /Users/spotify-buildagent/buildAgent/work/1e0ce8a77adfb2dc/client/base/_apple/_ios/os_ios.mm:287
2013-10-31 15:43:54 -0700 muzik[297] <Error> *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Keychain error when fetching device ID, nonrecoverable'
*** First throw call stack:
(0x2e265e8b 0x385ca6c7 0x2e265d5d 0x2ec0e29b 0x2ea90f 0x2eaee5 0x2e7bb3 0x1a618d 0x1a545d 0x2e230f55 0x2e2302cf 0x2e22ebd5 0x2e199541 0x2e1dd1ab 0x1a55a1 0x2ec49dc7 0x38be0c5d 0x38be0bcf 0x38bdecd0)

详细日志为 uploaded here (跳伞)

MFI 共享的完整崩溃日志

Date/Time:           2013-10-31 15:43:54.065 -0700
OS Version:          iOS 7.0.2 (11A501)
UDID:                41ab058a88eb7c1c3976828019bdfa0bd5edae22
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  7

Filtered syslog:
2013-10-31 15:43:52 -0700 muzik[297] <Warning> Flurry: Starting session on Agent Version [Flurry_iOS_120_4.2.4] 
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:53 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:54 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:54 -0700 muzik[297] <Error>  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (com.apple.security.osstatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (com.apple.security.osstatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
2013-10-31 15:43:54 -0700 muzik[297] <Warning> *** Assertion failure in NSString* base::deviceIdFromKeychain()(), /Users/spotify-buildagent/buildAgent/work/1e0ce8a77adfb2dc/client/base/_apple/_ios/os_ios.mm:287
2013-10-31 15:43:54 -0700 muzik[297] <Error> *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Keychain error when fetching device ID, nonrecoverable'
*** First throw call stack:
(0x2e265e8b 0x385ca6c7 0x2e265d5d 0x2ec0e29b 0x2ea90f 0x2eaee5 0x2e7bb3 0x1a618d 0x1a545d 0x2e230f55 0x2e2302cf 0x2e22ebd5 0x2e199541 0x2e1dd1ab 0x1a55a1 0x2ec49dc7 0x38be0c5d 0x38be0bcf 0x38bdecd0)

最佳答案

重要错误在这里:

The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)

现在,至于你为什么触发它,我不知道。尝试用 Google 搜索该特定错误 — 它不是 Spotify 特有的。

但是,您似乎正在将 Spotify 凭据存储在钥匙串(keychain)中,并且您可能会通过清除钥匙串(keychain)中的内容来触发问题。不幸的是,“我们正在调用一个方法”并不是有用的信息。

现在,您不应该将 Spotify 凭据存储在钥匙串(keychain)中。绝对不是用户密码——这违反了服务条款。 CocoaLibSpotify 为您提供可以安全存储在 NSUserDefaults 中的 token 。

您可以在库附带的“Empty CocoaLibSpotify”示例项目中找到如何正确存储 Spotify 凭据的示例。

此外,在将存档版本提交到 App Store 之前,请尝试测试它们。如果在审核期间发生这种情况,则没有理由不在本地触发此操作。

关于ios - 由于 Spotify 问题,应用程序在启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19724152/

相关文章:

javascript - 循环对象数组 - TypeError : Cannot read property 'name' of undefined

javascript - Spotify 播放按钮 : handle play/stop programmatically

python - Spotify API 后调用 – 响应 415?

objective-c - 无法读取 plist

ios - 如何在不使用 UIWebView 的情况下在 iOS 10 中显示带有 HTML 标签的文本(使用 swift)

iphone - 使用 sqlite3_step(statement) 进行不一致但频繁的 EXC_BAD_ACCESS 访问

iphone - 用于删除 HTML-head-tag 的正则表达式

ios - Segue 不在 ViewController 之间传递数据

ios - 清除 Swift UI 和 ObservableObject 对象数据

iphone - 无法通过我的 xcode 运行 doxygen 脚本?