ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.99k stars 997 forks source link

[Feature]: Make iOS SPM platform version configurable #7544

Closed rlepinski closed 2 months ago

rlepinski commented 3 months ago

Description

Make iOS platform configurable when using SPM

Platforms

Request or proposed solution

Make it possible to specify the iOS platform version when using SPM.

Right now this template is used to generate an SPM file that pulls in all plugins (I think) -https://github.com/ionic-team/capacitor/blob/main/ios-spm-template/App/CapApp-SPM/Package.swift#L7, the issue it hardcodes the platform version to 13, so if any plugin requires a newer version the build fails:

Build description signature: 6a7936b36114b559756987b40a32458e
        Build description path:
        /Users/ryan.lepinski/git/capacitor-airship/example/ios/DerivedData/066711CA-4B15-4D77-AEBF-095C11722530/Build/Intermediates.noindex/XCBuildData/6a7936b36114b559756987b40a32458e.xcbuilddata
        error: The package product 'UaCapacitorAirship' requires minimum platform version 14.0 for the iOS platform, but
        this target supports 13.0 (in target 'CapApp-SPM' from project 'CapApp-SPM')
        ** BUILD FAILED **

If i modify the spm.js file that has that template embedded to use v14, build works as expected.

Alternatives

No response

Additional Information

You can install the @ua/capacitor-airship 2.0.0 plugin to reproduce this

The Package.swift with the issue: https://github.com/urbanairship/capacitor-airship/blob/main/Package.swift

ionitron-bot[bot] commented 3 months ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙

rlepinski commented 3 months ago

Reproduced here - https://github.com/urbanairship/capacitor-airship/tree/spm-issue/example

npx cap build ios will produce the issue since its trying to pull in an SPM that is for iOS 14+ but the generated Package.swift is hardcoded to iOS 13

ionitron-bot[bot] commented 3 months ago

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.

ionitron-bot[bot] commented 1 month ago

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.