使用cocoapods break build更新libs

时间:2017-04-03 16:52:03

标签: xcode cocoapods afnetworking magicalrecord

自从尝试更新某些框架后,我遇到了问题。我使用pod更新,之后无法构建我的项目。错误消息是:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
      objc-class-ref in ...
      objc-class-ref in ...
  "_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
      objc-class-ref in ...
      objc-class-ref in ...
  "_OBJC_CLASS_$_AFNetworkActivityIndicatorManager", referenced from:
      objc-class-ref in ....
  "_OBJC_CLASS_$_AFNetworkReachabilityManager", referenced from:
      objc-class-ref in ....
      objc-class-ref in Utils.o
  "_OBJC_CLASS_$_CSNotificationView", referenced from:
      objc-class-ref in ...+Utils.o
      objc-class-ref in ...
      objc-class-ref in ...
      objc-class-ref in ...
      objc-class-ref in ...
      objc-class-ref in ...
      objc-class-ref in ...
      ...
  "_OBJC_CLASS_$_GAI", referenced from:
      objc-class-ref in ....
  "_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
      objc-class-ref in ....
  "_OBJC_CLASS_$_IQKeyboardManager", referenced from:
      objc-class-ref in .....
  "_OBJC_CLASS_$_LTHPasscodeViewController", referenced from:
      objc-class-ref in .....
      objc-class-ref in LTHPasscodeViewController+Config.o
      l_OBJC_$_CATEGORY_LTHPasscodeViewController_$_Config in LTHPasscodeViewController+Config.o
      objc-class-ref in ...
      objc-class-ref in ....
      objc-class-ref in ....
      objc-class-ref in ....
      ...
  "_OBJC_CLASS_$_MagicalRecord", referenced from:
      objc-class-ref in .....
  "_OBJC_CLASS_$_PCPieChart", referenced from:
      objc-class-ref in ....
  "_OBJC_CLASS_$_PCPieComponent", referenced from:
      objc-class-ref in ....
  "_OBJC_CLASS_$_UICKeyChainStore", referenced from:
      objc-class-ref in .....
  "_kGAIScreenName", referenced from:
      +[.... trackWithName:] in ....
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试删除这些框架并手动安装但不成功,兼容性还可以,但我不知道发生了什么。移除派生数据也没有用...有人可以帮助我吗?

编辑:podfile

    platform:ios, '7.0'

inhibit_all_warnings!

pod 'AFNetworking'
pod 'MagicalRecord', '~> 2.3.0'
pod 'GoogleAnalytics', '~> 3.13'
pod 'iOSPlot', '~> 1.0.1'
pod 'CSNotificationView', '~> 0.5.4'
pod 'MACircleProgressIndicator', '~> 1.0.0'
pod 'LTHPasscodeViewController', '~> 3.7.1'
pod 'IQKeyboardManager', '~> 3.3.4'
pod 'Rollbar'
pod 'UICKeyChainStore', '~> 2.0.6'

target 'xxxxx' do
    pod 'OCMock', '~> 3.2'
    pod 'OHHTTPStubs', '~> 4.3'
end

1 个答案:

答案 0 :(得分:0)

您的Podfile应如下所示,并为您的unittest-target设置明确的目标定义和继承的search_paths (请参阅official ref):

target ABC do
    platform:ios, '7.0'

    inhibit_all_warnings!

    pod 'AFNetworking'
    pod 'MagicalRecord', '~> 2.3.0'
    pod 'GoogleAnalytics', '~> 3.13'
    pod 'iOSPlot', '~> 1.0.1'
    pod 'CSNotificationView', '~> 0.5.4'
    pod 'MACircleProgressIndicator', '~> 1.0.0'
    pod 'LTHPasscodeViewController', '~> 3.7.1'
    pod 'IQKeyboardManager', '~> 3.3.4'
    pod 'Rollbar'
    pod 'UICKeyChainStore', '~> 2.0.6'

    target 'xxxxx' do
        inherit! :search_paths
        pod 'OCMock', '~> 3.2'
        pod 'OHHTTPStubs', '~> 4.3'
    end
end

如果要将任何新pod整合到项目中,请务必运行pod install而不只是pod update。(请参阅why)。

您的最后一个选择是从sratch开始pod整合:

  1. 从项目pod deintegrate
  2. 中完全删除pod
  3. 使用pod install
  4. 重新整合广告连播