我在iOS模拟器4.2/4.3上运行应用程序时遇到以下错误。它在iOS 5上运行得很好。
dyld: Library not loaded: /System/Library/Frameworks/Accounts.framework/Accounts
Referenced from: /Users/User/Library/Application Support/iPhone Simulator/4.3/Applications/FBFD053F-E816-4114-AFEB-D90A6A67259B/SampleApp.app/SampleApp
Reason: image not found我在我的应用程序中使用了AssetsLibrary和OpenCV框架。我找不到错误的原因。
发布于 2012-06-06 18:55:05
您会收到此错误,因为Accounts.framework仅在iOS 5.0或更高版本中可用。所以你不能在iOS 4.2/4.3上运行它。
您还可以将Accounts.framework标记为可选。在Xcode中,选择Targets > Build Targets> Link with binary libraries > Accounts.framework并标记为可选。
另外,请确保在iOS 4.3中跳过此代码(需要iOS 5.0或更高版本的代码)。您可以使用以下代码检查这一点:
NSString *reqSysVer = @"5.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) {
//Add any code that requires iOS 5.0
}发布于 2012-07-11 16:35:47
更好的是,你可以保留它,但将它从Link Binary With Libraries:从required改为optional。然后,在4.x设备中,在代码中跳过框架方法。
https://stackoverflow.com/questions/10912737
复制相似问题