2

我们正在开展一个从 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)

详细日志在这里上传(跳伞)

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)
4

1 回答 1

2

重要的错误在这里:

操作无法完成。(OSStatus 错误 -34018 - 客户端既没有应用程序标识符也没有钥匙串访问组权利)

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

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

现在,您不应该将 Spotify 凭据存储在钥匙串中。绝对不是用户密码——这违反了 ToS。CocoaLibSpotify 为您提供可以安全存储在NSUserDefaults.

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

此外,在将存档版本提交到 App Store 之前,请尝试测试它们。如果它在审查期间发生,没有理由不应该在本地触发。

于 2013-11-01T17:42:12.273 回答