Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
Description
Using folder name for local packages identity causes conflicts when multiple packages are in a folder with the same name.
You can see two different Capacitor plugins with different names, i.e.
https://github.com/capacitor-community/device/blob/master/Package.swift#L5
https://github.com/ionic-team/capacitor-plugins/blob/main/device/Package.swift#L5
Since Capacitor installs plugins from npm, despite their Package names are different, they are installed locally from node_modules and they both have device as containing folder due to how npm works.
I saw this similar issue related to remote dependencies
#8471
But in this case it doesn't need to be dependencies, just local packages with different names but in a folder with the same name.
Expected behavior
It should use the defined name in the Package.swift instead of the folder name.
Actual behavior
Conflicting identity for device: dependency 'node_modules/@capacitor/device' and dependency 'node_modules/@capacitor-community/device' both point to the same package identity 'device'.
Steps to reproduce
-
clone repository https://github.com/jcesarmobile/devicecollision
-
run npm install
-
run npm run build
-
run npx cap sync
-
run npx cap open ios
That opens Xcode, see that the dependencies are not added
-
run cd ios/App/CapApp-SPM/
-
run swift build
You'll see the conflicting identity message
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2)
Target: arm64-apple-macosx15.0
Darwin OS-M2FLFJX2V2 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:58 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T6041 arm64
Is it reproducible with SwiftPM command-line tools:
swift build,swift test,swift packageetc?swift build,swift test,swift packageetc.Description
Using folder name for local packages identity causes conflicts when multiple packages are in a folder with the same name.
You can see two different Capacitor plugins with different names, i.e.
https://github.com/capacitor-community/device/blob/master/Package.swift#L5
https://github.com/ionic-team/capacitor-plugins/blob/main/device/Package.swift#L5
Since Capacitor installs plugins from npm, despite their Package names are different, they are installed locally from node_modules and they both have
deviceas containing folder due to how npm works.I saw this similar issue related to remote dependencies
#8471
But in this case it doesn't need to be dependencies, just local packages with different names but in a folder with the same name.
Expected behavior
It should use the defined name in the Package.swift instead of the folder name.
Actual behavior
Conflicting identity for device: dependency 'node_modules/@capacitor/device' and dependency 'node_modules/@capacitor-community/device' both point to the same package identity 'device'.
Steps to reproduce
clone repository https://github.com/jcesarmobile/devicecollision
run
npm installrun
npm run buildrun
npx cap syncrun
npx cap open iosThat opens Xcode, see that the dependencies are not added
run
cd ios/App/CapApp-SPM/run
swift buildYou'll see the conflicting identity message
Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version ; uname -a)swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2)
Target: arm64-apple-macosx15.0
Darwin OS-M2FLFJX2V2 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:58 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T6041 arm64