Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to build module 'XXX' from its module interface while creating xcframework

Currently I am working in a framework project to distribute to a client we have. The Framework has SPM dependencies and I wanted to create an XCFramework from it. I found the scripts to archive and generate the XCFramework with the xcodebuild tool. The problem is that the generation is not working and I get the following error Failed to build module 'XXX' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced. I don't know if it is possible to build a framework with SPM dependencies as an XCFramework I was trying to distribute it as binary framework to protect our source code. I previously looked for this but couldn't found any information in the matter. Can somebody help me?

like image 401
Otto Cheley Avatar asked Jan 08 '21 17:01

Otto Cheley


Video Answer


1 Answers

One solution seems to add @_implementationOnly import for the modules from the third-party SDKs. This should fix your XCframework error if you aren't using anything from that SDK as part of your module's public interface.

like image 77
Martin Avatar answered Oct 21 '22 14:10

Martin