Skip to content

[Bug]: iOS package resolution fails for plugins with packageOptions.symlink on 9.0.0 #8769

Done

Description

@robingenz

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/app and @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-check and github.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

  1. A new Capacitor 9.0.0 app that uses SPM for iOS.

  2. Install @capacitor/app 9.0.2.

  3. Add this to capacitor.config.json:

    {
      "experimental": {
        "ios": {
          "spm": {
            "packageOptions": {
              "@capacitor/app": {
                "symlink": true
              }
            }
          }
        }
      }
    }
  4. npx cap sync ios

  5. xcodebuild -project ios/App/App.xcodeproj -scheme App -resolvePackageDependencies

Additional Information

I can open a pull request for this.

Activity

  1. alexgerardojacinto commented on Dec 4, 2026

    @alexgerardojacinto
    Contributor

    @robingenz thanks for the report! The PR is merged and this should be released soon

  2. alexgerardojacinto commented on Dec 4, 2026

    @alexgerardojacinto
    Contributor

    @robingenz 9.1.0 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions