2016-11-11 94 views
1

我已经继承了一个使用cocoapods的iOS项目。运行“pod安装”后Xcode无法找到接口声明

回购包括Pods目录,其中包含所有必要的豆荚及时冻结。如果我克隆回购并构建应用程序,一切都很好。如果我运行pod update再建,我得到一个错误:

Cannot find interface declaration for COOperation.

这个问题似乎是一个叫CompositeOperations库,它是由特定的git帐户(而不是直接从的CocoaPods被拉 - 如果不知道重要但只是试图尽可能多地提供信息)。 Xcode发现库很好,但由于某种原因,它没有加载在接口文件中声明的类。

在回购中包含Pods目录似乎很愚蠢。我觉得开发人员应该克隆回购,然后发行git install以便拉低所有依赖。

对于我需要调整的任何建议,以便Xcode成功构建我的项目?

MessageScreenDataFetchOperation.h实际的错误是:

/Users/user/src/myapp/myapp-iOS/Classes/Shared/Operations/MessageScreenDataFetchOperation.h:13:46: Cannot find interface declaration for 'COOperation', superclass of 'MessageScreenDataFetchOperation'; did you mean 'NSOperation'?

而这里的MessageScreenDataFetchOperation.h样子:

#import <CompositeOperations/COOperation.h> 

@protocol GroupRef; 

@interface MessageScreenDataFetchOperation : COOperation 
- (id)initWithMessageId:(NSNumber *)messageId group:(id <GroupRef>)groupRef memberId:(NSNumber *)memberId; 
@end 

这里是我的Podfile:

platform :ios, '8.0' 

source 'https://github.com/CocoaPods/Specs.git' 

target :MyTarget do 
    pod 'RestKit', '~> 0.24.0' 
    pod 'CompositeOperations', :git => 'https://github.com/stanislaw/CompositeOperations.git' 

    pod 'MBProgressHUD', '~> 0.8' 
    pod 'EKKeyboardAvoiding', '~> 2.0' 
    pod 'RBStoryboardLink', '0.1.0' 
    pod 'SWRevealViewController', '~> 2.0.0' 
    pod 'youtube-ios-player-helper', :git => 'https://github.com/stanislaw/youtube-ios-player-helper', :branch => '0.1.1-and-no-ads' 
    pod 'SZTextView' 

    pod 'MagicKit', :git => 'https://github.com/stanislaw/MagicKit' 
    pod 'ECPhoneNumberFormatter', :git => 'https://github.com/enriquez/ECPhoneNumberFormatter.git' 
    pod 'SSKeychain' 
    pod 'Mantle' 
    pod 'RSEnvironment', :git => 'https://github.com/rabovik/RSEnvironment' 

    pod 'FBSDKCoreKit' 
    pod 'FBSDKLoginKit' 
    pod 'FBSDKShareKit' 

    # Analytics 
    pod 'FlurrySDK', '5.1.0' 
    pod 'Fabric' 
    pod 'Crashlytics' 

    pod 'NewRelicAgent' 

    # Logging 
    pod 'EchoLogger', :git => 'https://github.com/stanislaw/EchoLogger' 
    pod 'AFNetworkingLogger', :git => 'https://github.com/stanislaw/AFNetworkingLogger' 
end 

target :MyTargetUnitTests do 
    pod 'OCMock', '~> 3.0' 
    pod 'Kiwi' 
    pod 'JPSimulatorHacks', :git => 'https://github.com/plu/JPSimulatorHacks' 
end 
+0

您应该可能会显示您的pod文件,有问题的声明以及您如何导入lib ... –

+0

谢谢@ l'L'l,我粘贴了上面的所有内容。 – djibouti33

回答

0

原来是烘烤到Xcode项目的版本是一个旧版本。 Podfile不受版本号的限制,所以运行'pod update'将库更新为最新版本,该版本发生了重大变化,使得它与我的代码库不兼容。

我想通过在运行pod update后区别Podfile.lock并发现版本差异很大。

我继续删除Pods目录和.xcworkspace文件,但修改了Podile以限制基于特定标记的库。

相关问题