You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SwiftPM will be the default for all Flutter apps in the next stable release (3.44). To ensure your plugin remains compatible and prevents build failures for your users, please migrate to SwiftPM
Flutter will eventually deprecate and then remove support for CocoaPods. Adding Swift Package Manager support future-proofs your plugins.
How to add Swift Package Manager support to your plugins
If you run into issues or have questions, please reach out to the Flutter team. You can send a message to the #hackers-ios channel on Flutter's discord or open a GitHub issue.
Thank you for your wonderful contributions to the Flutter ecosystem!
Why is Flutter migrating to Swift Package Manager?
Swift Package Manager support is one of Flutter's most requested features: flutter#33850.
Flutter's Swift Package Manager integration has several benefits:
Access to the Swift package ecosystem. Flutter plugins can use the growing ecosystem of Swift packages.
Simplifies Flutter installation. Swift Package Manager is bundled with Xcode. In the future, you won't need to install Ruby and CocoaPods to target iOS or macOS.
Reacted by GeorgePagMezzi, Kyler Kupres, Felipe P. Fuzaro and Arthur Masson
@sunitaprajapati89@MichaelGHSeg@neelkanth-kaushik
I see SPM support is already merged and just pending a release, but the last one was 7 months ago. Do you have any idea when the next release might go out?
Asking because Cocoapods is no longer in development. Flutter explicitly says support will be removed in a future release and lists Segment as an unsupported library, so this is becoming a bit of a blocker for us.
Some new company-wide security requirements have significantly slowed us down. We're trying to get a release out soon. In the meantime, for a less than ideal workaround, you could direct your dependency to our git repo:
Hi @MichaelGHSeg,
Running on the iOS 26.3 simulator and an iOS 26.4.2 physical device, with segment_analytics: 1.1.12 the warning still appears, and the package is only running via CocoaPods.
Also, it would be great if you could update the flutter_fgbg dependency. (According to the changelogs, SPM it's available in flutter_fgbg: 0.8.0)
Hey, Regarding segment_analytics still showing the SPM warning on 1.1.12:
The Package.swift was included in the 1.1.12 release, so the warning should be resolved once your local pub cache reflects the latest version. Please try the following:
flutter pub upgrade segment_analytics flutter pub get
If the warning persists, clear your pub cache and retry:
flutter pub cache clean flutter pub get
Also double-check your pubspec.lock to confirm segment_analytics is resolving to 1.1.12 and not an older cached version.
Regarding flutter_fgbg SPM support:
You're right that flutter_fgbg: 0.8.0 adds SPM support. However, upgrading to it requires Dart SDK ^3.8.0 (Flutter 3.44+), which is a significant bump from our current minimum of >=3.2.0. Making that change would drop support for users on Flutter versions below 3.44.
We'd like to address this — could you let us know which Flutter version you're targeting? That will help us decide the right time to make this a hard requirement. In the meantime, the warning is non-fatal and the package continues to build correctly via CocoaPods.
We'll track bumping flutter_fgbg to ^0.8.0 alongside a future minimum Flutter version update.
Thanks. I confirmed this is not a cache or version-resolution issue.
pubspec.lock resolves segment_analytics 1.1.12 from pub.dev.
Flutter 3.44.9 expects the manifests at:
ios/segment_analytics/Package.swift
macos/segment_analytics/Package.swift
However, 1.1.12 publishes them as ios/Package.swift and macos/Package.swift. Flutter therefore does not detect SPM support and continues integrating the plugin through CocoaPods.
The manifests also appear to need:
Library product name segment-analytics rather than segment_analytics
A FlutterFramework package and target dependency
Sources located within the nested Swift package structure
This is confirmed by Segment being absent from Flutter’s generated SPM manifest while still appearing in Podfile.lock.
Clearing the pub cache simply downloads the same package layout again.
Hi!
Thanks, I tested this now but segment_analytics is still reported as not supporting SPM.
I tested to fix this locally and the working structure was:
packages/core/ios/segment_analytics/Package.swift
packages/core/ios/segment_analytics/Classes/*.swift
The manifest also required:
Library product named segment-analytics
A FlutterFramework package dependency
FlutterFramework added as a target dependency
Target path set to Classes
With these changes:
segment_analytics disappeared from Flutter’s SPM warning
It was added to FlutterGeneratedPluginSwiftPackage
It was removed from Podfile.lock
The build succeeded
Your current test branch fixes the product name, but still needs the nested package/source structure and FlutterFramework dependency.
Activity
amrgetment commentedon May 19, 2026
This warning is currently shown on Flutter 3.44.0 and is expected to become an error in the first Flutter release after 3.44.0.
GeorgePagMezzi commentedon May 22, 2026
This is pretty important for us as well as we will be unable to move to newer flutter versions if this does not get supported.
GeorgePagMezzi commentedon Jun 26, 2026
Any updates on this?
vitormf commentedon Jul 7, 2026
@sunitaprajapati89 @MichaelGHSeg @neelkanth-kaushik
I see SPM support is already merged and just pending a release, but the last one was 7 months ago. Do you have any idea when the next release might go out?
Asking because Cocoapods is no longer in development. Flutter explicitly says support will be removed in a future release and lists Segment as an unsupported library, so this is becoming a bit of a blocker for us.
MichaelGHSeg commentedon Jul 8, 2026
Some new company-wide security requirements have significantly slowed us down. We're trying to get a release out soon. In the meantime, for a less than ideal workaround, you could direct your dependency to our git repo:
or fork our repo yourself if you want more control.
lazytesting commentedon Jul 23, 2026
@MichaelGHSeg any news on this?
MichaelGHSeg commentedon Jul 30, 2026
Thanks for your patience. We finally got the green light to do a release, it should be available now. Let us know if there are any issues.
lazytesting commentedon Jul 30, 2026
Thanks @MichaelGHSeg!
Anderzzon commentedon Aug 5, 2026
We still get the warning that this plugin doesn't support SPM. It would also be great if you could update to the latest version of flutter_fgbg
ArthurMassonBit commentedon Aug 11, 2026
Hi @MichaelGHSeg,
Running on the iOS 26.3 simulator and an iOS 26.4.2 physical device, with
segment_analytics: 1.1.12the warning still appears, and the package is only running via CocoaPods.flutter_fgbgdependency. (According to the changelogs, SPM it's available influtter_fgbg: 0.8.0)Could you please take a look?
Thanks!
sunitaprajapati89 commentedon Aug 12, 2026
Hey,
Regarding segment_analytics still showing the SPM warning on 1.1.12:
The Package.swift was included in the 1.1.12 release, so the warning should be resolved once your local pub cache reflects the latest version. Please try the following:
flutter pub upgrade segment_analyticsflutter pub getIf the warning persists, clear your pub cache and retry:
flutter pub cache cleanflutter pub getAlso double-check your pubspec.lock to confirm segment_analytics is resolving to 1.1.12 and not an older cached version.
Regarding flutter_fgbg SPM support:
You're right that flutter_fgbg: 0.8.0 adds SPM support. However, upgrading to it requires Dart SDK ^3.8.0 (Flutter 3.44+), which is a significant bump from our current minimum of >=3.2.0. Making that change would drop support for users on Flutter versions below 3.44.
We'd like to address this — could you let us know which Flutter version you're targeting? That will help us decide the right time to make this a hard requirement. In the meantime, the warning is non-fatal and the package continues to build correctly via CocoaPods.
We'll track bumping flutter_fgbg to ^0.8.0 alongside a future minimum Flutter version update.
Anderzzon commentedon Aug 12, 2026
Thanks. I confirmed this is not a cache or version-resolution issue.
pubspec.lock resolves segment_analytics 1.1.12 from pub.dev.
Flutter 3.44.9 expects the manifests at:
However, 1.1.12 publishes them as ios/Package.swift and macos/Package.swift. Flutter therefore does not detect SPM support and continues integrating the plugin through CocoaPods.
The manifests also appear to need:
This is confirmed by Segment being absent from Flutter’s generated SPM manifest while still appearing in Podfile.lock.
Clearing the pub cache simply downloads the same package layout again.
sunitaprajapati89 commentedon Aug 12, 2026
Could you test with this in your pubspec.yaml?
segment_analytics:
git:
url: https://github.com/segmentio/analytics_flutter.git
ref: feat/test-spm-support-core
path: packages/core
Run flutter pub get and let us know if the SPM warning is gone on Flutter 3.44.9.
Anderzzon commentedon Aug 12, 2026
Hi!
Thanks, I tested this now but segment_analytics is still reported as not supporting SPM.
I tested to fix this locally and the working structure was:
packages/core/ios/segment_analytics/Package.swift
packages/core/ios/segment_analytics/Classes/*.swift
The manifest also required:
With these changes:
Your current test branch fixes the product name, but still needs the nested package/source structure and FlutterFramework dependency.
sunitaprajapati89 commentedon Aug 13, 2026
Hi,
could you test if the SPM warning is gone on Flutter 3.44.9 with the changes pushed now?
Anderzzon commentedon Aug 13, 2026
Hi,
Yes, the new version worked!
Anderzzon commentedon Aug 13, 2026
I created a new issue for flutter_fgbg to keep track on that:
#212