Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: Library not loaded: /System/Library/Frameworks/Accounts.framework/Accounts

I am getting the following error while running an app on iOS simulator 4.2/4.3. It's working fine with 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

I am using the AssetsLibrary and OpenCV frameworks in my app. I am not getting the cause of error.

like image 876
mahendraraut Avatar asked Jun 06 '12 10:06

mahendraraut


2 Answers

Better yet you could keep it but change it from Link Binary With Libraries: from required to optional. Then in your code skip the framework methods when in a 4.x device.

like image 92
Rivera Avatar answered Sep 26 '22 20:09

Rivera


You are getting this error because Accounts.framework is only available in iOS 5.0 or later. So you are not able to run it on iOS 4.2/4.3.

You can also mark Accounts.framework as optional. In Xcode, select Targets > Build Phases > Link with binary libraries > Accounts.framework and mark as optional.

Also please make sure to skip this code(code that requires iOS 5.0 or greater) in iOS 4.3. You can use the following code to check this :

NSString *reqSysVer = @"5.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) {

     //Add any code that requires iOS 5.0
}
like image 37
Vaquita Avatar answered Sep 25 '22 20:09

Vaquita