10

I just upgraded to Xcode 7 and CocoaPods 0.38.2 and, after resolving some Swift 2 issues, got the following linker error with my mixed Objective-C & Swift project targeting iOS 7:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RKManagedObjectRequestOperation", referenced from:
      objc-class-ref in NetworkHelper.o
  "_OBJC_CLASS_$_RKManagedObjectResponseMapperOperation", referenced from:
      type metadata accessor for ObjectiveC.RKManagedObjectResponseMapperOperation in MappingHelper.o
  "_RKLogCoreDataError", referenced from:
      ___33-[RKEntityByAttributeCache load:]_block_invoke in libRestKit.a(RKEntityByAttributeCache.o)
      ___43-[RKManagedObjectImporter finishImporting:]_block_invoke in libRestKit.a(RKManagedObjectImporter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

CoreData is included in my .pch file and is included before RestKit in the bridging header, and Bitcode is off. I'm using RestKit 0.24.1.

Since it appears that RestKit isn't detecting the presence of the CoreData framework and its conditional declarations are accordingly getting passed over, I've tried lots of various ways to tell my app or the RestKit pod about the presence of Core Data, but nothing seems to help.

pr1001
  • 21,727
  • 17
  • 79
  • 125
  • I just have the same issue of `Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RKManagedObjectRequestOperation", referenced from:` while not using any swift yet at all. – martn_st Sep 17 '15 at 13:13
  • Have you added the CoreData framework to your project? (http://www.binpress.com/tutorial/learn-objectivec-building-an-app-adding-frameworks-to-an-xcode-project/101) – William Power Sep 17 '15 at 19:44
  • @WilliamPower Yes, I did. It is apparently a CocoaPods issue with Xcode 7. – pr1001 Sep 17 '15 at 21:25
  • 1
    i just upgraded to Xcode 7 and i am having the same exact issue – drvannostran98 Sep 18 '15 at 04:54
  • I was able to resolve my issue by uninstalling cocoa pods and then reinstalling cocoa pods. After that i cleaned up the cocoa pods master repository by issuing the "pod repo remove master", did a "pod setup" and then "pod install" with a fresh version of RestKit 25.0 and everything worked fine. – drvannostran98 Sep 18 '15 at 18:48
  • @drvannostran98: which version of cocapods have you installed? – el.severo Sep 22 '15 at 09:42
  • I have installed version 38.2 – drvannostran98 Sep 22 '15 at 12:16
  • Try this answer by ilya [http://stackoverflow.com/questions/25248359/undefined-symbols-for-architecture-armv7-while-using-google-maps-ios-sdk-1-8-1](http://stackoverflow.com/questions/25248359/undefined-symbols-for-architecture-armv7-while-using-google-maps-ios-sdk-1-8-1) – karthikeyan Jun 17 '16 at 12:38

3 Answers3

4

I resolved this issue by following these steps:

  1. Upgrade my cocoapods (0.39.0)
  2. Goto build settings of my target and search for header search paths.
  3. Make all header search paths recursive (This is important) I also tried by my making recursive only to restkit but for some reason i don't know it does not work.
  4. Then disable the bitcode.
  5. Finally build.

Reference screenshot

For more information see this link

Muhammad Zeeshan
  • 2,441
  • 22
  • 33
1

Upgrading from an older version of RestKit (0.23.3) to 0.25.0 worked for me.

I also upgraded Xcode to 7.0.1, deleted xcworkspace, and reran pod install for good measure.

Lane Rettig
  • 6,640
  • 5
  • 42
  • 51
  • 1
    RestKit 24.1 and 25.0 break my RKManagedObject implementation https://github.com/RestKit/RestKit/issues/2312... so I actually want to downgrade, but then my linker won't work! FML! – CQM Oct 01 '15 at 21:09
0

upgrade you cocoapods and xcode7.0.1

and remove xcworkspace and pod install again.

TonnyTao
  • 532
  • 1
  • 5
  • 8