更新 RKLog.h 中未找到的 RestKit 'lcl_RK.h' 文件

Update RestKit 'lcl_RK.h' file not found in RKLog.h

我在 Xcode 7.1 中安装了 RestKit v0.25.0 和 CocoaPods v0.39,但导入有问题。当我使用 CocoaPods v0.38.2 时,一切都很棒。
“RKHTTPUtilities.h”文件未找到。它在 headers 搜索路径中为“${PODS_ROOT}/Headers/Public/RestKit”设置递归后解决。 但是我得到这个错误 'lcl_RK.h' file not found in RKLog.h.

我也试试 this.

我只找到一个不是最好的方法。在项目目标的 headers 搜索路径中添加“$(PODS_ROOT)/RestKit/Vendor/LibComponentLogging/Core”。

解释:lcl_RK.h 文件在文件夹路径 RestKit/Vendor/LibComponentLogging/Core 中,所有其他文件在文件夹 RestKit/Code/ 中。当 CocoaPods 生成 Headers 文件夹时,它缺少 lcl_RK.h 文件。

如果有人在使用 Xcode 7.3 的 Swift 项目中遇到 RestKit 0.26.0 和 Cocoapods 1.0.1 的问题,希望这会有所帮助!

这个解决方案至少在 2016 年 6 月 3 日有效,但由于它使用特定的 git 分支,这些分支可能会被合并,所以如果这对你不起作用,请检查是否 git 分支已经 merged/moved/deleted.

先清理再清理

退出Xcode

rm -rf Pods
rm -rf MyApp.xcworkspace  
rm -rf ~/Library/Caches/CocoaPods
rm -rf ~/Library/Developer/Xcode/DerivedData

使用mcfedr's RestKit fork

必须与 AFNetworking

的 "reachablility" 分支一起使用
pod 'AFNetworking', :git => 'https://github.com/mcfedr/AFNetworking.git', :branch => 'reachability'
pod 'RestKit', :git => 'https://github.com/mcfedr/RestKit.git', :branch => 'pods1'

在桥接中使用模块导入语法Header

@import RestKit;

现在应该可以了!