Skip to content

Prompt plugin authors to add Swift Package Manager compatibility to their plugin #148222

Description

@vashworth
  • When detected that a flutter project is a plugin example app that has a podspec but doesn't have a Package.swift, prompt the user to add Swift Package Manager compatibility and point to documentation with instructions on how to do that.

/// Expected path to the plugin's Package.swift. Returns null if the plugin
/// does not support the [platform] or the [platform] is not iOS or macOS.
String? pluginSwiftPackageManifestPath(
FileSystem fileSystem,
String platform,
) {
final String? platformDirectoryName = _darwinPluginDirectoryName(platform);
if (platformDirectoryName == null) {
return null;
}
return fileSystem.path.join(
path,
platformDirectoryName,
name,
'Package.swift',
);
}
/// Expected path to the plugin's podspec. Returns null if the plugin does
/// not support the [platform] or the [platform] is not iOS or macOS.
String? pluginPodspecPath(FileSystem fileSystem, String platform) {
final String? platformDirectoryName = _darwinPluginDirectoryName(platform);
if (platformDirectoryName == null) {
return null;
}
return fileSystem.path.join(path, platformDirectoryName, '$name.podspec');
}

bool get hasExampleApp => _exampleDirectory(directory).existsSync();

FlutterProject get example => FlutterProject(
_exampleDirectory(directory),
_exampleManifest,
FlutterManifest.empty(logger: globals.logger),
);

bool get isPlugin => manifest.isPlugin;

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    team-iosOwned by iOS platform team
    triaged-iosTriaged by iOS platform team
    on May 13, 2024
  2. stuartmorgan-g commented on May 13, 2024

    @stuartmorgan-g
    Contributor

    I like it!

    (Longer term, we'll want to more aggressively reach long-tail plugin developers by warning end users if they are using a plugin without SPM support, so that we can eventually remove Cocoapods, but that would be probably a couple of releases after SPM support is on stable.)

  3. added theissue type on Apr 2, 2025
  4. self-assigned this
    on Jan 29, 2026
  5. added a commit that references this issue on Mar 19, 2026
    8335876
  6. added a commit that references this issue on Mar 26, 2026
    9c8b1f2
  7. github-actions commented on Apr 2, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Apr 2, 2026
  9. added a commit that references this issue on Apr 14, 2026
    4736b8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions