Skip to content

[Bug]: Capacitor 8 + Swift Package Manager: CapApp-SPM generated but plugin products are not exposed in Xcode #8325

@zermenoeduardo06-sys

Description

@zermenoeduardo06-sys

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 8.0.2
@capacitor/core: 8.0.2
@capacitor/android: 8.0.2
@capacitor/ios: 8.0.2

Installed Dependencies:

@capacitor/cli: 8.0.0
@capacitor/core: 8.0.0
@capacitor/android: 8.0.0
@capacitor/ios: 8.0.0

[success] iOS looking great! 👌

Other API Details

npm --version output:
10.x

node --version output:
v20.x

pod --version output (iOS Cocoapods issues only):
Not applicable (this project explicitly uses Swift Package Manager, not CocoaPods)

Capacitor CLI:
@capacitor/cli 8.x

Capacitor iOS:
@capacitor/ios 8.x

Xcode:
Xcode 15.x

macOS:
macOS Sonoma

Additional details:
- iOS platform added using: npx cap add ios --packagemanager SPM
- CocoaPods is NOT installed or used
- CapApp-SPM/Package.swift is generated successfully
- Capacitor reports plugins found for iOS
- However, Xcode does not expose any plugin products from CapApp-SPM
- This blocks linking plugins to the App target entirely

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

After running npx cap add ios --packagemanager SPM:

  1. CapApp-SPM should appear in Xcode's Package Dependencies ✓ (works)
  2. CapApp-SPM products (CapacitorApp, plugin libraries) should be available in "Frameworks, Libraries, and Embedded Content" ✗ (broken)
  3. These products should be auto-linked to the App target, or at minimum be selectable manually

The SPM workflow should match the CocoaPods experience where plugins are automatically available after cap sync.

Expected Behavior

https://github.com/user/capacitor-spm-bug-repro

Steps:

  1. Create new Capacitor 8 project
  2. Install plugins: npm install @capacitor/camera @capacitor/haptics
  3. Run: npx cap add ios --packagemanager SPM
  4. Open ios/App/App.xcodeproj in Xcode 15+
  5. Navigate to App target → General → Frameworks
  6. Click "+" and observe no CapApp-SPM products available

Project Reproduction

https://github.com/zermenoeduardo06-sys/chefly-ai-nutrition-coach-7e9f3e0d/tree/main/capacitor-spm-bug-repro

Additional Information

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions