2017-04-03 79 views
1

我遇到了問題,因爲嘗試更新一些框架。我使用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) 

我試圖刪除這些框架和手動安裝,但不成功,兼容性好,但我不知道是什麼happening.Remove得出的數據並沒有太多工作...有人能幫助我?

編輯: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 
+0

您可以發佈您Podfile嗎? –

+0

@SvenDriemecker使用podfile編輯答案 – breadevelopment

+0

如果這是您的完整Podfile,請嘗試將主要部分封裝到目標'ABC'do ... end中。你的UnitTest-Target只有一個明確的目標部分。另外,如果您在上次工作後添加了新的Pod,請確保運行Pod安裝,而不是僅更新Pod。 –

回答

0

你Podfile應該是這樣的,有一個明確的目標定義和繼承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集成到您的項目中(請參閱why),請務必運行pod install而不是僅運行pod update

你的最後一個選項是從扔在一邊開始莢整合:

  1. 完全從項目中刪除莢pod deintegrate
  2. 再集成豆莢與pod install