问题描述
我进行了"pod更新",我的RestKit版本现在是0.25.0,我的RKValueTransformers是1.1.2,并且出现了错误消息"RKObjectMapping.h".
I "pod update", and my RestKit version now is 0.25.0, my RKValueTransformers is 1.1.2, and an error appeared "RKObjectMapping.h" not found.
RestKit在新版本中做了什么更改,我检查了它的github找不到任何东西.
What did RestKit change in the new version, that I check on the its github cannot find anything.
以下步骤可以重现该错误:
The following steps can reproduce the error:
1)创建一个新项目
2)pod初始化
Podfile如下:
Podfile looks like:
platform :ios, '8.3'
#pod 'RestKit', '~> 0.20.0'
#pod 'RestKit', '~> 0.24.1'
pod 'RestKit'
在所有不同版本的情况下,问题都是相同的
In all cases of different versions, the issue is the same
3)打开.xcworkspace
3) open .xcworkspace
4)在viewcontroller.m
4) in the viewcontroller.m
#import <RestKit/ObjectMapping/RKObjectMapping.h>
#import <RestKit/ObjectMapping/RKRelationshipMapping.h>
#import <RestKit/Network/RKResponseDescriptor.h>
#import <RestKit/Network/RKObjectRequestOperation.h>
#import <RestKit/Support/RKLog.h>
#import <RestKit/CoreData/RKEntityMapping.h>
#import <RestKit/Network/RKObjectManager.h>
或
#import "RKObjectMapping.h"
#import "RKRelationshipMapping.h"
#import "RKResponseDescriptor.h"
#import "RKObjectRequestOperation.h"
#import "RKLog.h"
#import "RKEntityMapping.h"
#import "RKObjectManager.h"
错误仍然存在:在RestKit Pod的文件中找不到"RKObjectMapping.h"
The error is still there: "RKObjectMapping.h" not found in a file of RestKit Pod
注意:我正在使用Xcode 7-beta5,Objective-C
Note: I am using Xcode 7-beta5, Objective-C
推荐答案
一段时间后,我发现错误不是来自RestKit.它来自升级最新版本的cocoapods(0.39.beta.4).
After a while struggling, I noticed the error is not from RestKit. It comes from upgrading the latest version of cocoapods (0.39.beta.4).
标题搜索路径不再处于递归模式.
The Header Search Path is not in recursive mode anymore.
解决方法只是将cocoapods的版本降级为0.38.0.
The workaround is just downgrade the version of cocoapods to 0.38.0.
1)删除最新版本的cocoapod
1) remove the latest version of cocoapod
sudo gem uninstall cocoapods
2)安装0.38.0版本
2) install the 0.38.0 version
sudo gem install cocoapods -v 0.38.0
希望可以帮助某人.
已更新:
感谢Vig,我们可以使用特定版本的Pod:
Thanks Vig that we can do pod with a specific version:
pod _0.38.0_ update
pod _0.38.0_ install
这篇关于找不到RKObjectMapping.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!