Repository navigation
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
- 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.
flutter/packages/flutter_tools/lib/src/plugins.dart
Lines 392 to 418 in 708fe97
| /// 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(); |
flutter/packages/flutter_tools/lib/src/project.dart
Lines 253 to 257 in 708fe97
| FlutterProject get example => FlutterProject( | |
| _exampleDirectory(directory), | |
| _exampleManifest, | |
| FlutterManifest.empty(logger: globals.logger), | |
| ); |
| bool get isPlugin => manifest.isPlugin; |
- Also, if they do have a Package.swift, validate that they have a dependency on the FlutterFramework. See https://github.com/flutter/flutter/blob/master/packages/integration_test/ios/integration_test/Package.swift as example
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
stuartmorgan-g commentedon May 13, 2024
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.)
Prompt plugin authors to add Swift Package Manager compatibility to t…
Prompt plugin authors to add Swift Package Manager compatibility to t…
github-actions commentedon Apr 2, 2026
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 -vand a minimal reproduction of the issue.Prompt plugin authors to add Swift Package Manager compatibility to t…