我已经继承了一个使用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
您应该可能会显示您的pod文件,有问题的声明以及您如何导入lib ... –
谢谢@ l'L'l,我粘贴了上面的所有内容。 – djibouti33