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

dam*_*ndd 5 xcode linker-errors ios cocoapods 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)
Run Code Online (Sandbox Code Playgroud)

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

file was built for archive which is not the architecture being linked (arm64)
Run Code Online (Sandbox Code Playgroud)

活动架构还可以,我已经尝试删除派生数据文件夹,重新安装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
Run Code Online (Sandbox Code Playgroud)

Mar*_*rku 8

尝试清除XCode缓存:

rm -rf ~/Library/Developer/Xcode/DerivedData/
Run Code Online (Sandbox Code Playgroud)

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

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
Run Code Online (Sandbox Code Playgroud)

最后转到"Pods"项目并将"Build Active Architectures Only"设置为"No",以用于"Debug"配置.

参考 /sf/answers/2655158831/


Meh*_*hul 0

请使用下面的 Pod 代码。

\n\n
source 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, \xe2\x80\x989.0\xe2\x80\x99\nuse_frameworks!\n\ntarget \xe2\x80\x9cNoteCheck\xe2\x80\x9d do\n\n    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => \xe2\x80\x984.0.1\xe2\x80\x99\n    pod 'AlamofireNetworkActivityIndicator',    '~> 2.0'\n    pod 'AlamofireObjectMapper',        '~> 4.0.0'\n    pod 'UIActivityIndicator-for-SDWebImage',   '~> 1.2'\n    pod 'SVProgressHUD'         ,:git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'\n    pod 'Reachability',             '~> 3.2'\n    pod 'SwiftyJSON',               '~> 3.0.0'\n    pod 'ObjectMapper' ,            '~> 2.0'\n    pod 'SDWebImage',               '~> 3.8'\n\n    pod 'SZTextView',               '~> 1.2'\n    pod 'TPKeyboardAvoiding',           '~> 1.3'\n    pod 'FXBlurView' ,              '~> 1.6.4'\n    pod 'AMSmoothAlert',            '~> 1.0'\n\n    pod 'DGElasticPullToRefresh',       '~> 1.1'\nend\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n