Unable to create XCFramework

We planned to create XCFramework for two libraries TDCore and TDApi and integrate the framework within an app that we have. However we are unable to create XCFramework to contain both libraries



TDCore is standalone library, however TDApi has a dependency to TDCore and the app needs to use both libraries inorder to fuction correctly.



TDCore -> No Dependency

TDApi -> Dependencies: TDCore.framework (embed:Do Not Embed)

App -> Dependencies to TDCore and TDApi using XCFramework


xcodebuild -archive generates archives for both TDCore and TDApi successfully. (4 archive in total for simulator,device)



The problem is having all these archives, we can not generate TDAPI.xcframework and the xcbuild command failes with the error :


Command:


xcodebuild -create-xcframework -framework ../Frameworks/tdapi_device.xcarchive/Products/Library/Frameworks/TDAPI.framework -framework ../Frameworks/tdapi_simulator.xcarchive/Products/Library/Frameworks/TDAPI.framework -framework ../Frameworks/tdcore_simulator.xcarchive/Products/Library/Frameworks/TDCore.framework -framework ../Frameworks/tdcore_simulator.xcarchive/Products/Library/Frameworks/TDCore.framework -output ../Frameworks/TDAPI.xcframework


Result:

2019-08-14 16:53:30.804 xcodebuild[85549:2370964] [MT] PluginLoading: Required plug-in compatibility UUID 07BAA045-2DD3-489F-B232-D1D4F8B92D2D for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/ClangFormat.xcplugin' not present in DVTPlugInCompatibilityUUIDs

A library with the identifier "ios-x86_64-simulator" already exists.



Would be great if someone could see if there's a bug with Xcodebuild or anything missing to use the command correctly.

I just tried to do the same thing, and got the same result. Honestly, I was expecting the failure, though I had hoped that it would Just Work™.


Based on all of the documentation I've seen on the subject, I'm led to believe that that all of the `-framework` arguments need to reference the same framework. The ability to provide multiple arguments is to allow for the destination-specific variants of that framework to be combined. In your case, you'd need two separate `xcodebuild -create-xcframework` commands, one for TDCore, and one for TDAPI.


It would be nice if I could do what we both tried to do... that is, combine multiple frameworks into one xcframework bundle. As long as every framework is equally represented across destinations, I think it could work, but I'm probably missing an edge case somewhere.

Unable to create XCFramework
 
 
Q