Conversation
Changes: - rename the Package.swift library product to CapacitorCommunityCameraPreview so Capacitor 8 SPM consumers can resolve the plugin - keep the existing Swift target name and podspec unchanged - wire the example-app Xcode project to the generated CapApp-SPM local package - keep the example-app on the migrated SPM flow so Xcode build/run works again for local validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes iOS Swift Package Manager support for Capacitor 8 by aligning the plugin's exported Swift package product name with what Capacitor generates for SPM consumers.
It also keeps the example app on the migrated SPM-based iOS setup and wires the local
CapApp-SPMpackage into the Xcode project so the example app can be opened, built, and run again for local validation.Changes
fix the root
Package.swiftlibrary product name mismatchCapacitorCommunityCameraPreviewPlugintoCapacitorCommunityCameraPreviewrestore a working example-app iOS SPM workflow
CapApp-SPMpackage intoApp.xcodeprojWhy this change is needed
Capacitor 8 generates SPM references using the plugin name-derived product name
CapacitorCommunityCameraPreview, but the plugin previously exported the library product asCapacitorCommunityCameraPreviewPlugin.That mismatch caused SPM resolution to fail for iOS consumers.
Separately, after migrating the example app from CocoaPods to SPM, the Xcode project still needed local package wiring so
import Capacitorand the full app build could work again.Validation
Verified locally with:
Notes