Pod update leads to "defining a duplicate interface for the xxx class" for all AWS SDKs (El Capitan + Xcode 7)

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

dyld: warning, LC_RPATH @executable_path /../../../../../../../ SharedFrameworks in /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/ ../../..//DVTInstrumentsFoundation.framework/Versions/A/DVTInstrumentsFoundation is ignored in the restricted program due to @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 is ignored in the restricted program due to @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 is ignored in the restricted program due to @executable_path

dyld: warning, LC_RPATH @executable_path /../ Frames in /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/MacOS/Xcode3Core are ignored in the restricted program due to @executable_path

Then, when I opened my project and built, I had so many build crashes complaining about the same Duplicate interface for class XXX :

enter image description here

I tried many solutions, reinstalled SDS SDKs, reinstalled cocoapods, downgraded coco files to 0.38.2, downgraded AWS SDK levels to 2,6,6, but none help. If I comment on the import in the Objective-C bridge header, I don't have these errors, but Xcode just complains that it won't find some classes used in the codes. But I do not think that commenting on them is the right decision. enter image description here

Well, I searched for https://github.com/CocoaPods/CocoaPods/issues/4302 , and it looks like this might be a problem with cocoapods?

Anyone have an idea on this? Thanks.

+5
source share
1 answer

Answer (hopefully :))

  • remove #import from bridge header
  • add "import AWSS3" (or whatever class you need) in the corresponding Swift files

Explanation

Starting with version 0.36 of Cocoapod, you do not need to import containers through the bridge header if they are in Swift code or if they declare "use_frameworks!". (which AWS did in version 2.2.1

Edit

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

+3
source

Source: https://habr.com/ru/post/1233897/


All Articles