pod update results in “duplicate interface definition for class xxx” for all AWS SDK (El Capitan + XCode 7)

╄→гoц情女王★ 提交于 2019-12-07 05:09:47

问题


Just now, I updated my AWS SDK pods, which I regretted so much. I first saw this when pods were being updated:

dyld: warning, LC_RPATH @executable_path/../../../../../../../SharedFrameworks in /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/../../..//DVTInstrumentsFoundation.framework/Versions/A/DVTInstrumentsFoundation being ignored in restricted program because of @executable_path dyld: warning, LC_RPATH @executable_path/../lib in /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework/Versions/A/../../../../Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib being ignored in restricted program because of @executable_path

dyld: warning, LC_RPATH @executable_path/../lib in /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework/Versions/A/../../../../Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib being ignored in restricted program because of @executable_path

dyld: warning, LC_RPATH @executable_path/../Frameworks in /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/MacOS/Xcode3Core being ignored in restricted program because of @executable_path

Then when I opened my project and build, I got so many so many build failures, complaining the same thing Duplicate interface definition for class XXX:

I have tried many solutions, reinstall AWS SDK pods, reinstall cocoapods, downgrade cocoapods to 0.38.2, downgrade AWS SDK pods to 2.2.6, but none helps. If I comment out the imports in Objective-C bridge header, I don't have these errors but Xcode just complaints about not finding some of the classes used in the codes. But I don't think commenting them out is the right solution.

Well, I searched https://github.com/CocoaPods/CocoaPods/issues/4302, and it seems it could be cocoapods' problem?

Anyone has any idea on this? Thanks.


回答1:


Answer (hopefully :))

  • remove the #import from the bridging header
  • add "import AWSS3" (or whichever class you need) in the appropriate Swift files

Explanation

Since version 0.36 of Cocoapods, you don't need to import pods via the bridging header if they are in Swift code OR if they declare "use_frameworks!" (which AWS did in their version 2.2.1

Edit

In my case, I replaced "pod 'AWSiOSSDKv2', '~> 2.0'" with "pod 'AWSS3', '~> 2.2.0'" and added "#import " in the bridging file.



来源:https://stackoverflow.com/questions/33180650/pod-update-results-in-duplicate-interface-definition-for-class-xxx-for-all-aws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!