[英]Xcode 7 linker error with RestKit and CocoaPods
我剛剛升級到Xcode 7和CocoaPods 0.38.2,在解決了一些Swift 2問題之后,針對iOS 7的我的Objective-C和Swift混合項目出現了以下鏈接器錯誤:
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包含在我的.pch文件中,並且包含在橋接頭中的RestKit之前,並且Bitcode已關閉。 我正在使用RestKit 0.24.1。
既然RestKit似乎沒有檢測到CoreData框架的存在,並且它的條件聲明也相應地被傳遞了,所以我嘗試了多種方法來告訴我的應用程序或RestKit pod有關Core Data的存在,但是什么也沒有似乎有幫助。
我按照以下步驟解決了這個問題:
有關更多信息, 請參見此鏈接
從較早版本的RestKit
(0.23.3)升級到0.25.0對我來說很有效。
我也將Xcode升級到7.0.1,刪除了xcworkspace,並重新運行了pod install
以取得良好的效果。
升級您的cocoapods和xcode7.0.1
並刪除xcworkspace和pod再次安裝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.