CocoaPods 1.0.1重新定义“ XYZ”,重新定义枚举器“ ABC”,重复定义“ MNO”的接口 [英] CocoaPods 1.0.1 Redefinition of 'XYZ', Redefinition of enumerator 'ABC', Duplicate interface definition for 'MNO'

查看:157
本文介绍了CocoaPods 1.0.1重新定义“ XYZ”,重新定义枚举器“ ABC”,重复定义“ MNO”的接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将CocoaPods(0.39.0)升级到最新版本(1.0.1),并移动了一些直接集成的框架(复制在主项目中,而不是使用CocoaPods-spec)。我正在使用XCode(7.2.1)。



以下是与CocoaPods 1.0.1一起使用的podfile:



<前置平台:ios, 8.0目标 ABC-v2可以做#动态框架集成需要use_framework。 use_frameworks! pod'SSKeychain','〜> 1'pod'Mantle','〜> 1'pod'GoogleAPIClient / Drive','〜> 1'pod'GTMOAuth2','〜> 1'pod'GTMSessionFetcher' pod'libextobjc / EXTScope','〜> 0.4'pod'台风','〜> 3'#快速框架测试,最终将需要此功能。 #pod'Alamofire','〜> 3'#PSPDFKit-5.8.3 pod'PSPDFKit',podspec:'https://customers.pspdfkit.com/cocoapods/.../latest.podspec'#暂时将其禁用找出xcode构建错误。 #target:SSS做#pod'ABC-iOS-SDK',:path => submodules / abc-ios-sdk #end#暂时将其禁用,以区分出xcode构建错误。 #target:TW do#pod'ABC-iOS-SDK',:path => ‘submodules / abc-ios-sdk’#end目标:ABCTest确实继承了! :search_paths窗格 OCMock,〜> 3’pod‘OCMockito’,’〜> 1窗格 VCRURLConnection,〜> 0.2’,:inhibit_warnings =>真正的端点



现在,我正在尝试解决构建时的编译错误,




  • 请参阅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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆