Xcode 12, Workspaces and the new "XCFrameworks" not working together

Viewed 277

I have a project, made up multiple smaller projects. I manage this mess generally through Carthage, but for development, I make use of a xcworkspace, to make it easier and faster to make changes, and Xcode to build the child and master projects via the workspace.

I've recently started updating all the projects to make use of the new XCFrameworks format (instead of the "fat frameworks" which Carthage/Xcode use to generate).

If I'm just working on the root project (xcproject) and linking the XCFrameworks directly, it all works fine. The moment I switch to the xcworkspace and replace any of the XCFrameworks with it's XCProject, the build fails

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/gnuwolzggqlzhlfiipjzbigitmvu/Build/Products/Debug-iphoneos/....framework':
1) Command: ProcessXCFramework /Users/.../Development/.../.../Carthage/Build/....xcframework /Users/.../Library/Developer/Xcode/DerivedData/gnuwolzggqlzhlfiipjzbigitmvu/Build/Products/Debug-iphoneos/....framework ios
2) Command: ProcessXCFramework /Users/shanew/Development/.../Libraries/.../Carthage/Build/....xcframework /Users/.../Library/Developer/Xcode/DerivedData/gnuwolzggqlzhlfiipjzbigitmvu/Build/Products/Debug-iphoneos/....framework ios

The sub project frameworks DO NOT embedded their dependencies (as if I recall, this caused other issues) and dependency management is managed through Carthage, so the root project AND the child project will share dependencies, which I think is the cause of the issue.

I had some "minor" luck, if I built the sub project first and then remove its "Frameworks, Libraries, and Embedded Content", I could get the root project to work, but when I tried to do this with multiple sub projects I started to run into issues.

I did note that when I remove the xcframeworks and replace it with the project, it displays the project with the "fat framework" icon, instead of the xcframeworks icon ... I doubt this part of the issue, but thought I'd mention it...

Selector

So, the question...

How do we include "sub projects"/"frameworks", which have xcframeworks dependencies (shared with other projects) into a xcworkspace and have it build without triggering the "Multiple commands produce ... output" errors.

0 Answers
Related