Is this setup possible / have a solution:
- There is a .xcframework F, which uses a 3rd party library, lets call it L.
- There is an app which uses the xcframework
- The app also uses L
- Both the app and F use SPM to integrate L
F is using L for its own internal purposes. F is providing some functionality to the app. How it implements that ideally should be a black box from the app's perspective.
The app also happens to use L for its own purposes.
I can't get this set up working, always get warnings about duplicate symbols when running the App. This will presumably be due to the fact there are separate copies of L in both F and A. So how can that be eliminated?
Can F not statically like to L and use the App's version of L at runtime? If so how can Xcode be configured so that F can actually compile?
Or vice versa - can the App not statically link in its own copy of L and use that in the framework? If so, similar questions, how to configure Xcode to set this up?
I can't believe this is an obscure use case, yet after days of searching and reading documentation I can't find any solution.
Note that I was able to get this going when the app and the framework used Cocoapods to integrate L, but I just can't do similarly if the use of Cocoapods is replaced with SMP.
When using cocoapods, within the frameworks Xcode section, the pods framework is set to Do Not Embed. This is probably the vital difference between the working Cocoapods implementation and the not working SPM solution. However, when using SPM Xcode doesn't present any option to either embed nor not embed the dependency. Why not? Can it somehow be set to not embed?