Closed 7-plus-t closed 4 days ago
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 branch: "main"
as well.
This issue has been labeled as type: bug
. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.
Thanks @jcesarmobile :)
For the readers: see https://github.com/ionic-team/capacitor-plugins/pull/2221 for fix in plugins
see https://github.com/ionic-team/capacitor-plugins/pull/2221 for fix in plugins
Cool, thanks
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