iOS未定义的体系结构符号x86_64 Xcode

时间:2016-07-05 11:45:49

标签: ios objective-c xcode cocoapods linker-errors

我在我的应用中安装了一些第三方框架。每件事都很好,突然有一天我开始出现以下错误。请注意,只有当我尝试在iOS模拟器上运行我的应用程序时才会出现这些链接器错误。

Undefined symbols for architecture x86_64:
  "_AFNetworkingOperationFailingURLResponseDataErrorKey", referenced from:
      ___61-[DataManager signupWithEmail:password:name:success:failure:]_block_invoke.127 in DataManager.o
      ___46-[DataManager favoriteLesson:success:failure:]_block_invoke.311 in DataManager.o
      ___48-[DataManager unfavoriteLesson:success:failure:]_block_invoke.345 in DataManager.o
  "_AFStringFromNetworkReachabilityStatus", referenced from:
      ___41-[DataManager startObservingReachability]_block_invoke in DataManager.o
  "_OBJC_CLASS_$_ADJConfig", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_ADJEvent", referenced from:
      objc-class-ref in TrackingHelper.o
  "_OBJC_CLASS_$_AFCompoundResponseSerializer", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFHTTPRequestSerializer", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFHTTPResponseSerializer", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFNetworkReachabilityManager", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AFURLSessionManager", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_AMTagView", referenced from:
      objc-class-ref in CategorySelectionViewController.o
  "_OBJC_CLASS_$_Adjust", referenced from:
      objc-class-ref in AppDelegate.o
      objc-class-ref in TrackingHelper.o
  "_OBJC_CLASS_$_CarbonTabSwipeNavigation", referenced from:
      objc-class-ref in MyProfileViewController.o
      objc-class-ref in SearchResultsContainerViewController.o
  "_OBJC_CLASS_$_FBSDKAccessToken", referenced from:
      objc-class-ref in SignUpViewController.o
      objc-class-ref in MyProfileViewController.o
  "_OBJC_CLASS_$_FBSDKAppEvents", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FBSDKLoginManager", referenced from:
      objc-class-ref in SignUpViewController.o
      objc-class-ref in DataManager.o
      objc-class-ref in LoginViewController.o
  "_OBJC_CLASS_$_MGSwipeButton", referenced from:
      objc-class-ref in LessonsViewController.o
  "_OBJC_CLASS_$_MGSwipeTableCell", referenced from:
      _OBJC_CLASS_$_LessonTableViewCell in LessonTableViewCell.o
  "_OBJC_CLASS_$_Mixpanel", referenced from:
      objc-class-ref in AppDelegate.o
      objc-class-ref in InitialViewController.o
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_WYPopoverController", referenced from:
      objc-class-ref in GuideViewController.o
  "_OBJC_METACLASS_$_MGSwipeTableCell", referenced from:
      _OBJC_METACLASS_$_LessonTableViewCell in LessonTableViewCell.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助都将受到高度赞赏。我可以调试,构建和存档我的项目,如果我在实际设备上但不在模拟器上。我已经通过cocapods添加了所有这些框架,我正在使用Xcode 7.3。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误。如下所示

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
      objc-class-ref in CuebiqSDK(BADispatcherHelper.o)
  "_OBJC_CLASS_$_AFURLSessionManager", referenced from:
      objc-class-ref in CuebiqSDK(BADispatcherHelper.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我还没有在错误中提到的项目中添加 AFURLSessionManager 相关。所以,我添加了所有AFNetworking类解决了这个问题。确保将它们添加到项目目标并显示在Build phases-> Compile Sources

enter image description here