Xcode 8:找不到架构arm64 for pods的符号

时间:2016-10-05 10:32:05

标签: ios xcode cocoapods linker-errors xcode8

更新到Xcode 8后,应用程序不会在设备上运行,只能在模拟器上运行。添加到项目中的所有pod都会抛出错误:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_AFNetworkReachabilityManager", referenced from:
      objc-class-ref in FeedViewController.o
  "_OBJC_CLASS_$_TSMessage", referenced from:
      l_OBJC_$_CATEGORY_TSMessage_$_Override in NotificationMessenger.o
      objc-class-ref in NotificationMessenger.o
  "_OBJC_CLASS_$_AFHTTPRequestSerializer", referenced from:
      objc-class-ref in HTTPSessionTask.o
  "_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
      objc-class-ref in HTTPSessionTask.o
  "_OBJC_METACLASS_$_SWTableViewCell", referenced from:
      _OBJC_METACLASS_$_MessagesCell in MessagesCell.o
      _OBJC_METACLASS_$_PaymentMethodCell in PaymentMethodCell.o
      _OBJC_METACLASS_$_SwipeTitleCell in SwipeTitleCell.o
  "_OBJC_CLASS_$_FBRequestConnection", referenced from:
      objc-class-ref in FacebookManager.o
  "_OBJC_CLASS_$_SWTableViewCell", referenced from:
      _OBJC_CLASS_$_MessagesCell in MessagesCell.o
      _OBJC_CLASS_$_PaymentMethodCell in PaymentMethodCell.o
      _OBJC_CLASS_$_SwipeTitleCell in SwipeTitleCell.o
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in FacebookManager.o
  "_OBJC_CLASS_$_AFURLSessionManager", referenced from:
      objc-class-ref in HTTPSessionTask.o
  "_OBJC_CLASS_$_Branch", referenced from:
      objc-class-ref in MyImpactViewController.o
      objc-class-ref in UINavigationController+Activity.o
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in FacebookManager.o
      objc-class-ref in ExternalFacebookCommand.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

对于每个文件,也会抛出此警告:

file was built for archive which is not the architecture being linked (arm64)

活动架构没问题,我尝试删除派生数据文件夹,重新安装pod,将Build Active Architectures Only设置为YES和NO,但没有任何作用。

我的Podfile如下所示:

platform :ios, '8.0'
workspace 'Purple'
target 'Purple' do
pod 'AFNetworking', '2.6.3'
pod 'SAMKeychain', '~> 1.3'
pod 'TSMessages'
pod 'Facebook-iOS-SDK', '~> 3.23.2'
pod 'SWTableViewCell'
pod 'CardIO'
pod 'Parse'
pod 'PureLayout'
pod 'Branch'
pod 'DZNEmptyDataSet'
end

3 个答案:

答案 0 :(得分:8)

尝试清除XCode缓存:

rm -rf ~/Library/Developer/Xcode/DerivedData/

清除CocoaPods缓存并重新安装依赖项:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

最后去" Pods"项目并将“仅构建活动架构”设置为“否”也用于“#34;调试"配置。

参考 https://stackoverflow.com/a/37930840/1773009

答案 1 :(得分:0)

请使用以下广告代码。

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.0’
use_frameworks!

target “NoteCheck” do

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => ‘4.0.1’
    pod 'AlamofireNetworkActivityIndicator',    '~> 2.0'
    pod 'AlamofireObjectMapper',        '~> 4.0.0'
    pod 'UIActivityIndicator-for-SDWebImage',   '~> 1.2'
    pod 'SVProgressHUD'         ,:git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'
    pod 'Reachability',             '~> 3.2'
    pod 'SwiftyJSON',               '~> 3.0.0'
    pod 'ObjectMapper' ,            '~> 2.0'
    pod 'SDWebImage',               '~> 3.8'

    pod 'SZTextView',               '~> 1.2'
    pod 'TPKeyboardAvoiding',           '~> 1.3'
    pod 'FXBlurView' ,              '~> 1.6.4'
    pod 'AMSmoothAlert',            '~> 1.0'

    pod 'DGElasticPullToRefresh',       '~> 1.1'
end

//某些cocoapod库支持最低IO9.0支持。因此,请尝试将部署目标最小化为9.0并检查所有cocoapod swift3.0支持的库。编辑pod文件后,更新pod。

答案 2 :(得分:0)

“OPN [Debug]目标会覆盖OTHER_LDFLAGS构建设置”。这是主要问题。在其他链接器标志的新行中添加$(inherited)后解决了我的问题。

enter image description here