I have two frameworks in my project, each of which depend on the same Swift package (in this case RxSwift, but I don't think that's important).
To get the project to build I've had to include the same package in both targets (via the "Frameworks and Libraries" list in the target's General settings) - otherwise when I try to import the package it can't find it.
When I run my app I see warnings in the console like:
objc[79287]: Class _TtC9Alamofire18UploadTaskDelegate is implemented in both
/Users/deanWombourne/Desktop/PackageManagerTest/DerivedData/PackageManagerTest/
Build/Products/Debug-iphonesimulator/Framework1.framework/Framework1 (0x110877e00)
and
/Users/deanWombourne/Library/Developer/CoreSimulator/Devices/2319A320-1A01-4784-B85E-272FF0F999CB/
data/Containers/Bundle/Application/D40DE3EA-DD78-4241-B307-070CDAF8BFA1/PackageManagerTest.app/PackageManagerTest (0x10f9858c8).
One of the two will be used. Which one is undefined.
and, sometimes, the app crashes in the package which is duplicated.
I've tested the app by building a version without the duplicate package issue (copy/paste all code into the same target!) and it runs fine then, so this is something to do with the duplicate package issue.
So, what's my question?
Is there any way in Xcode to specify that a single package will be included in two targets, but not to just copy it twice into the executable?
I'd ideally like to specify it as a dynamic library of some sort so it's not baked into the executable at all but is loaded on demand - but any solution is welcome at this point!
EDIT
I also get this issue if I have only one framework but it shares the RxSwift package dependency with the main app target.