> 'MyPackage' dependency on 'https://github.com/optimizely/swift-sdk' conflicts with dependency on 'https://github.com/iterable/swift-sdk' which has the same identity 'swift-sdk'. this will be escalated to an error in future versions of SwiftPM.
We also get this error:
Failed to resolve dependencies Dependencies could not be resolved because 'MyPackage' depends on 'swift-sdk' 3.7.0 and root depends on 'swift-sdk' 6.0.0..<7.0.0.
For the error, the first 'swift-sdk' that is 3.7.0 is the Optimizely package, while the latter is the Iterable package. How can this be solved? Is there a way to specify these are different packages?
edit: 'MyPackage' has the dependency on Optimizely, while the core project has it for Iterable. So it should look like 'Core Project' -> 'MyPackage' -> 'Optimizely' and 'Core Project' -> 'Iterable'
I'd like to note that these Packages have different names. 'IterableSDK' and 'Optimizely'. The only thing they share is the end path component of 'swift-sdk'. Why is the package graph relying on the end path component rather than the whole url for its identity? Or not using the Package name as identity? Perhaps I'm not understanding something or doing the setup wrong?
Here is a screenshot of the Iterable package in our project settings. As seen the name of the package is 'swift-sdk'. However, when looking at the 'Package.swift' file, the name is 'IterableSDK' (swift-sdk/Package.swift at master · Iterable/swift-sdk · GitHub).
SwiftPM uses the last path component of URL as the "identity"; an option to specify explicit dependency names in SE-0226 was rolled back in an amendment due to user confusion.
The reason for not using the package name for package identity was outlined in an amendment to SE-0292, which considered its use as part of a registry service, as follows:
The core team returned SE-0292 for further discussion about package identifiers, but near as I can tell this discussion never reached a resolution as the proposal authors strongly objected to the core team decision. Based on the links in the proposal, no revision of package identifiers along the lines proposed in SE-0292 ever landed.