Repository navigation
Description
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:
flutter/packages/flutter_tools/lib/src/commands/build_swift_package.dart
Lines 1527 to 1551 in b49f9e9
| 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}'); | |
| } |
flutter/packages/flutter_tools/lib/src/xcode_project.dart
Lines 206 to 208 in b49f9e9
| if (parent.isModule) { | |
| return false; | |
| } |
Activity
saurabh-mirajkar commentedon Apr 6, 2026
@vashworth Thanks for filling this. Labelling for
team-toolto investigate further.Migrate Adapty SDK to 4.0 (Paywall → Flow) + iOS Swift-package pipeli…
[iOS][add2app] Skip building SwiftPM plugins when generating CocoaPod…
github-actions commentedon Sep 4, 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.