Post

Replies

Boosts

Views

Activity

XC14.2 - Multiple targets match implicit dependency for product reference
We have a large, complex workspace. Let's call the app OurApp, which is the top level project. In the workspace we also have a project FooController, with a framework target. For App Store reentry reasons, we have duplicated the framework target so that we now have FooController and FooController-MacAppStore. There is an .xcconfig file for the App Store target that sets its product name to FooController. The workspace contains schemes for OurApp and OurApp-MacAppStore, with the appropriate FooController selected (ie, OurApp-MacAppStore correctly references the FooController Xcode identifies as the product of FooController-MacAppStore). With a completely clean build (nuking the Derived Data folder and the module cache, for whatever good the latter will do), the build folder contains exactly ONE correctly-named FooController.framework, which appears to be the correct variant, and the build succeeds. Yet there is a persistent warning (under the "Build target OurApp-MacAppStore" group): Multiple targets match implicit dependency for product reference SketchPluginManager.framework. Consider adding an explicit dependency on the intended target to resolve this ambiguity. No other targets reference either FooController target except OurApp and OurApp-MacAppStore besides the test bundle. I've even tried deleting that, though no evidence suggested it was trying to build, and this same warning merely shifts to the test bundle if I build for test. I've tried adding a reference to FooController project under OurApp project and then adding the appropriate FooController targets (app store versus non) to their respective OurApp targets' Target Dependencies under Build Phases. This makes no difference. I've also tried (what I think may be voodoo as it may not apply to this case) adding DISABLE_DIAMOND_PROBLEM_DIAGNOSTIC=YES to the configs of all targets involved as seen in some Google-found threads about earlier Xcode versions. All to no avail. Of course I tried all of the above solutions together as well. I'm coming to the conclusion that this may be an Xcode bug. We're all-in with workspaces, as going to all-explicit dependencies on such a large and complicated codebase feels anti-pattern to future tools developments at best, and nearly unmanageable for a large team at worst. But we're starting to wonder if we need to do a ground-up switch to explicit dependencies. This makes me want to cry. We are using Xcode 14.2 on macOS 13.2.1. I'm out of things to try. Does anyone have any ideas here?
1
0
1.4k
Mar ’23