Repository navigation
Description
Capacitor Version
@capacitor/cli: 9.0.0
@capacitor/core: 9.0.0
@capacitor/ios: 9.0.0
Other API Details
- Xcode 27.2 (27B52), Swift 6.4.2, Node 24.21.0
- iOS uses Swift Package Manager
Platforms Affected
- iOS
- Android
- Web
Current Behavior
With experimental.ios.spm.packageOptions[<plugin>].symlink set to true, Swift package resolution fails after npx cap sync ios:
xcodebuild: error: Could not resolve package dependencies:
Conflicting identity for ios: dependency '<app>/ios/app/capapp-spm/symlinks/ios' and dependency '<app>/node_modules/@capacitor/ios' both point to the same package identity 'ios'.
The line appears once for every plugin that has the option.
In Capacitor 9, sync rewrites the Capacitor dependency in each plugin's Package.swift to a path dependency. cli/src/ios/update.ts passes plugin.rootPath as the base, so the path is relative to the real plugin folder, for example path: "../ios" for @capacitor/app. With symlink: true, the app package depends on symlinks/<Name> instead (cli/src/util/spm.ts). SwiftPM resolves the relative path from the symlink location and does not follow the link. So ../ios points to ios/App/CapApp-SPM/symlinks/ios, which does not exist.
This worked in Capacitor 8, because plugins depended on capacitor-swift-pm by URL.
The option is the only way to use two plugins whose folders have the same name, or a plugin whose folder has the same name as a remote package in the graph. Without the option, these combinations fail on 9.0.0 as well:
-
@capacitor/appand@capacitor-firebase/app:Conflicting identity for app: dependency '<app>/node_modules/@capacitor/app' and dependency '<app>/node_modules/@capacitor-firebase/app' both point to the same package identity 'app'. -
@capacitor-firebase/app-checkandgithub.com/google/app-check, which the Firebase SDK depends on:product 'AppCheckCore' required by package 'firebase-ios-sdk' target 'FirebaseAppCheck' not found in package 'app-check'.
Expected Behavior
Package resolution succeeds for plugins with symlink: true.
When I replace the path that sync wrote with one that is relative to the symlink folder (../../../../../node_modules/@capacitor/ios), the packages resolve, in the app from the steps below and in an app with both combinations above. So using the symlink folder instead of plugin.rootPath as the base for plugins with the option should fix it.
Project Reproduction
-
A new Capacitor 9.0.0 app that uses SPM for iOS.
-
Install
@capacitor/app9.0.2. -
Add this to
capacitor.config.json:{ "experimental": { "ios": { "spm": { "packageOptions": { "@capacitor/app": { "symlink": true } } } } } } -
npx cap sync ios -
xcodebuild -project ios/App/App.xcodeproj -scheme App -resolvePackageDependencies
Additional Information
I can open a pull request for this.
Activity
alexgerardojacinto commentedon Dec 4, 2026
@robingenz thanks for the report! The PR is merged and this should be released soon
alexgerardojacinto commentedon Dec 4, 2026
@robingenz
9.1.0is released.