3

I have installed some third party frameworks in my app. Every thing was working fine and suddenly one day i started to get the following errors. Please note that these linker errors appear only when i try to run my app on iOS Simulator.

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)

Any help will be highly appreciated. I can debug, build and archive my project, if i do it on actual device but not on simulator. I have added all these frameworks via cocapods and i am using Xcode 7.3.

Madu
  • 4,849
  • 9
  • 44
  • 78
  • 1
    You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually. Do this way TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run – Hitesh Surani Jul 05 '16 at 12:05
  • Add of the mentioned files are already in Compile Source Section. – Madu Jul 05 '16 at 12:09
  • remove all frameworks and add it again(in build phases) – Mehul Thakkar Jul 05 '16 at 12:11
  • Clean projects, clean derived data, reinstall pods. Worked for me. – Romain TAILLANDIER Sep 07 '16 at 10:51

1 Answers1

0

I had faced the same error. Like below

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)

I haven't added the AFURLSessionManager related classes in my project as mentioned in error. So, I added all the AFNetworking classes solved the problem. Make sure they are added to project target and shown under Build phases->Compile Sources

enter image description here

Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58