-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: SPM - capacitor-swift-pm.git Version declared to branch main #7735
Comments
We have faced the same problem in our project: the build suddenly started using the capacitor 7 alpha version which obviously is unacceptable for a productive app. A reproduction can be found here: https://github.com/ionic-team/capacitor-ios-spm-template/blob/main/template/App/CapApp-SPM/Package.swift - it is apparently a different dependency, but uses |
This issue has been labeled as |
This comment was marked as abuse.
This comment was marked as abuse.
see ionic-team/capacitor-plugins#2221 for fix in plugins |
Cool, thanks |
fixed in #7737 |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Capacitor Version
Latest Dependencies:
@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2
Installed Dependencies:
@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/ios: 6.1.2
@capacitor/android: 6.1.2
Other API Details
Platforms Affected
Current Behavior
Using the SPM beta for iOS:
In the
Package.swift
of CapApp-SPM, generated bynpx cap sync
, the dependency on Capacitor and Cordova is declared as follows:.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main"),
This causes SPM to use the latest commit of
https://github.com/ionic-team/capacitor-swift-pm.git
and therefore always the newest Capacitor version is used. This cannot be overridden by the parent app, as thebranch: "main"
overrules other constraintes likeexact
orfrom
when there is a conflict.A similar problem exists in all the Capacitor plugins that have been converted to the SPM structure, where in
Package.swift
the dependency to Capacitor is declared withbranch: "main"
.Expected Behavior
The
Package.swift
of CapApp-SPM and the plugins should be changed, so it states:.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "6.0.0"),
(or7.0.0
for the upcoming Capacitor release).This allows the parent app to declare the version of Capacitor to be used, without SPM resolution conflicts.
Project Reproduction
Use any plugin example app
Additional Information
No response
The text was updated successfully, but these errors were encountered: