【问题标题】:dyld: Library not loaded: /System/Library/Frameworks/Accounts.framework/Accountsdyld:库未加载:/System/Library/Frameworks/Accounts.framework/Accounts
【发布时间】:2012-06-06 10:51:14
【问题描述】:

在 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 框架。 我没有得到错误的原因。

【问题讨论】:

    标签: iphone ios xcode linker


    【解决方案1】:

    更好的是,您可以保留它,但将其从 Link Binary With Libraries: 从必需更改为可选。 然后在您的代码中跳过 4.x 设备中的框架方法。

    【讨论】:

      【解决方案2】:

      您收到此错误是因为 Accounts.framework 仅在 iOS 5.0 或更高版本中可用。所以你无法在 iOS 4.2/4.3 上运行它。

      您还可以将 Accounts.framework 标记为可选。在 Xcode 中,选择 Targets > Build Phases > 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
      }
      

      【讨论】:

      • 谢谢 :),我删除了这个框架,项目成功运行。
      猜你喜欢
      • 2014-08-07
      • 1970-01-01
      • 1970-01-01
      • 2021-04-28
      • 1970-01-01
      • 1970-01-01
      • 2011-06-25
      • 2015-07-23
      • 2021-05-15
      相关资源
      最近更新 更多