简体   繁体   English

通过cocoapods的Restkit无法在新项目上构建,找不到RKLog

[英]Restkit via cocoapods fails to build on new project, RKLog not found

I'm trying to use Restkit via CocoaPods for my first time, on a brand new project, but I encounter some issues building the project once Restkit is introduced: 我是第一次尝试在CocoaPods上使用Restkit,这是一个全新的项目,但是一旦引入了Restkit,我就会遇到一些构建项目的问题:

在此输入图像描述

I have followed these exact steps: 我已按照以下步骤操作:

  1. Created a brand new Xcode project, default options. 创建了一个全新的Xcode项目,默认选项。
  2. Created a podfile with the following contents : 创建了一个包含以下内容的podfile:

    platform :ios, '6.1' pod 'RestKit/Testing', '~> 0.20.0pre' pod 'RestKit/Search', '~> 0.20.0pre' 平台:ios,'6.1'pod'RestKit / Testing','〜> 0.20.0pre'pod'RestKit / Search','〜> 0.20.0pre'

  3. Run pod install then opened the workspace 运行pod install然后打开工作区

  4. Updated the prefix file as instructed here . 按照此处的说明更新了前缀文件。

I'm running these versions, all valid according to the Restkit documentation: 我正在运行这些版本,根据Restkit文档都有效:

  • Git git version 1.8.1.2 Git git版本1.8.1.2
  • CocoaPods 0.16.2 CocoaPods 0.16.2
  • Xcode 4.6 Xcode 4.6

Can anyone suggest what I may have done wrong, or what I can do to solve this? 任何人都可以建议我做错了什么,或者我能做些什么来解决这个问题? Thanks 谢谢

You have to include the base of Restkit as well. 您还必须包含Restkit的基础。 Add

pod 'RestKit', '~> 0.20.0pre'

To your Podfile. 到您的Podfile。

Found a solution described here . 找到这里描述的解决方案

It involves searching the project for #import and replacing it with #import . 它涉及在项目中搜索#import并将其替换为#import。 The project compiles! 该项目编译!

//#import <RestKit/RestKit.h>
#import <RestKit/CoreData.h>

In this case the offending file was RKOperationStateMachine 在这种情况下,违规文件是RKOperationStateMachine

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM