CocoaPods 1.0.1重新定义“ XYZ”,重新定义枚举器“ ABC”,重复定义“ MNO”的接口 [英] CocoaPods 1.0.1 Redefinition of 'XYZ', Redefinition of enumerator 'ABC', Duplicate interface definition for 'MNO'
问题描述
我正在将CocoaPods(0.39.0)升级到最新版本(1.0.1),并移动了一些直接集成的框架(复制在主项目中,而不是使用CocoaPods-spec)。我正在使用XCode(7.2.1)。
以下是与CocoaPods 1.0.1一起使用的podfile:
现在,我正在尝试解决构建时的编译错误,
- 请参阅CocoaPods迁移指南,网址为
编译时出现错误:
-
/ path ../ Pods / SSKeychain / Sources / SSKeychain.h:65:1:重复的界面类 SSKeychain的定义
-
/ path ../ Pods / SSKeychain / Sources / SSKeychain.h:22:27:重新定义 SSKeychainErrorCode
-
/ path ../ Pods / SSKeychain / Sources / SSKeychain.h:24:2:重新定义枚举器'SSKeychainErrorBadArguments'
请帮助删除这些错误的想法?
解决方案此问题已通过修改SSKeychain.h的导入语句来解决。
I am upgrading CocoaPods (0.39.0) to latest version (1.0.1) and moving some directly integrated frameworks (copied in the main project instead of using CocoaPods-spec). I am using XCode (7.2.1).
Following is the podfile that is used with CocoaPods 1.0.1:
platform :ios, '8.0' target 'ABC-v2' do # use_framework is required for dynamic frameworks integration. use_frameworks! pod 'SSKeychain', '~>1' pod 'Mantle', '~>1' pod 'GoogleAPIClient/Drive', '~>1' pod 'GTMOAuth2', '~>1' pod 'GTMSessionFetcher' pod 'libextobjc/EXTScope', '~>0.4' pod 'Typhoon', '~>3' # swift framework test, would need this eventually. #pod 'Alamofire', '~>3' # PSPDFKit - 5.8.3 pod 'PSPDFKit', podspec:'https://customers.pspdfkit.com/cocoapods/.../latest.podspec' #disabled it temporarily to separate out xcode build error. #target :SSS do # pod 'ABC-iOS-SDK', :path => 'submodules/abc-ios-sdk' #end #disabled it temporarily to separate out xcode build error. #target :TW do # pod 'ABC-iOS-SDK', :path => 'submodules/abc-ios-sdk' #end target :ABCTests do inherit! :search_paths pod 'OCMock', '~> 3' pod 'OCMockito', '~> 1' pod 'VCRURLConnection', '~> 0.2', :inhibit_warnings => true end end
Now I am trying to resolve compile errors upon build, which are related to libraries getting included multiple times.
- Referred to CocoaPods Migration Guide at http://blog.cocoapods.org/CocoaPods-1.0-Migration-Guide/
- Tried recompiling after complete clean (cmd-alt-shift-k), removing pod files (rm -rf Pods/ podfile.lock) & deleting DerivedData.
- Ensured that there is no duplicate *.a files in the Target->Build Phases->Link Binary with Libraries. Upon 'pod install', "Pods_ABC_v2.framework" is added there.
- Deleted other targets, such as Widget and an extension & disabled them in podfile as well.
- There is directly integrated evernote sdk (evernote-sdk-ios.xcodeproj), which has EVSSKeychain.h/.m files with modified definitions with EV prefix (EVSSKeychainErrorCode, EVSSKeychainErrorBadArguments, etc). Screenshot below:
- I believe above evernote sdk isn't causing the errors I am getting; I could try to remove evernote sdk (directly integrated), but I am not sure about it ??
Errors upon compilation:
/path../Pods/SSKeychain/Sources/SSKeychain.h:65:1: Duplicate interface definition for class ‘SSKeychain'
/path../Pods/SSKeychain/Sources/SSKeychain.h:22:27: Redefinition of 'SSKeychainErrorCode'
/path../Pods/SSKeychain/Sources/SSKeychain.h:24:2: Redefinition of enumerator 'SSKeychainErrorBadArguments'
Please help with the ideas to remove these errors?
解决方案This was fixed by modifying the import statements for SSKeychain.h
这篇关于CocoaPods 1.0.1重新定义“ XYZ”,重新定义枚举器“ ABC”,重复定义“ MNO”的接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-