Skip to content

Skip building SwiftPM plugins when building Pods for SwiftPM Add2App #184590

Closed

Description

@vashworth

When building the CocoaPods frameworks in SwiftPM Add2App for a module, it also builds the SwiftPM plugins that also support CocoaPods. We don't need to build them, though, since they will be added as SwiftPM dependencies.

In addition, modules build a FlutterPluginRegistrant framework, which is also not needed for SwiftPM.

This is because modules use a custom podhelper.rb, which explicitly adds a FlutterPluginRegistrant pod.

Also, in the plugin install podhelper function, it does not skip SwiftPM plugins because it's disabled for modules:

Future<Map<String, List<Directory>>> _buildCocoaPodsForSdk({
required XcodeSdk sdk,
required FlutterDarwinPlatform platform,
required String xcodeBuildConfiguration,
required bool buildStatic,
required Directory outputBuildDirectory,
required Directory podsDirectory,
}) async {
final String configuration = _configurationForSdkType(sdk, xcodeBuildConfiguration);
final ProcessResult buildPluginsResult = await _utils.processManager.run(<String>[
..._utils.xcode.xcrunCommand(),
'xcodebuild',
'-alltargets',
'-sdk',
sdk.platformName,
'-configuration',
configuration,
'SYMROOT=${outputBuildDirectory.path}',
'ONLY_ACTIVE_ARCH=NO', // No device targeted, so build all valid architectures.
'BUILD_LIBRARY_FOR_DISTRIBUTION=YES',
if (buildStatic) 'MACH_O_TYPE=staticlib',
], workingDirectory: podsDirectory.path);
if (buildPluginsResult.exitCode != 0) {
throwToolExit('Unable to build CocoaPod plugin frameworks: ${buildPluginsResult.stderr}');
}

if (parent.isModule) {
return false;
}

Activity

  1. saurabh-mirajkar commented on Apr 6, 2026

    @saurabh-mirajkar
    Contributor

    @vashworth Thanks for filling this. Labelling for team-tool to investigate further.

  2. added
    platform-iosiOS applications specifically
    platform-macosBuilding on or for macOS specifically
    team-toolOwned by Flutter Tool team
    a: buildBuilding flutter applications with the tool
    and removed
    in triagePresently being triaged by the triage team
    on Apr 6, 2026
  3. added
    team-iosOwned by iOS platform team
    and removed
    team-toolOwned by Flutter Tool team
    on Apr 20, 2026
  4. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Apr 23, 2026
  5. github-actions commented on Sep 4, 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.

  6. locked as resolved and limited conversation to collaborators on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions