Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

CocoaPods refuses a Swift pod that depends on a pod without modules

ErrorThe following Swift pods cannot yet be integrated as static libraries:

Short answer

CocoaPods builds Swift pods as static libraries only if every pod they import defines a module. When a dependency such as an Objective-C pod does not, pod install stops. Enable modular headers for that pod, or for all pods, in the Podfile. For Firebase, building pods as frameworks with use_frameworks! is the other documented route.

  • Applies to CocoaPods 1.16, Flutter 3.50 stable, Xcode 26, Firebase iOS SDK 12
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read which pod depends on which. The message names both: the Swift pod, and the dependency that has no module. The second name is the one to fix.

    cd ios
    pod install 2>&1 | grep -A4 "cannot yet be integrated"
  2. 2Match what you see, then jump to its fix

    1. 1... which does not define modules.A dependency does not define a moduleFix
    2. 2The same message, from a Podfile with no use_frameworks! line, while using Firebase podsPods are built as static libraries when Firebase expects frameworksFix

What does the error look like?

  • The following Swift pods cannot yet be integrated as static libraries:
  • ... does not define modules.

Cause 1 of 2

A dependency does not define a module

1Check

CocoaPods lets Objective-C pods import each other with plain quoted imports, and those imports do not work with module maps. A Swift pod can only import another pod as a module. The validator reports the dependency that has none.

sed -n 1,60p Podfile

2Fix

Opt that dependency into module map generation. Either set it for one pod by name, or turn it on for the whole target. Use the name from the error message.

# ios/Podfile, per pod
pod 'GoogleUtilities', :modular_headers => true

# or for every pod in the target
use_modular_headers!

3Verify

Install again; the error is gone and Pods are generated.

cd ios
pod install

Confirmed by blog.cocoapods.org

Did this fix it?

Cause 2 of 2

Pods are built as static libraries when Firebase expects frameworks

1Check

Without use_frameworks! CocoaPods builds every pod as a static library, which is what triggers the module requirement. Firebase documents two valid Podfile lines, one with dynamic and one with static linkage.

grep -n "use_frameworks\|use_modular_headers" ios/Podfile

2Fix

Build pods as frameworks. The Firebase guide recommends static linkage unless you need dynamic behaviour; it needs CocoaPods 1.9.0 or newer.

# ios/Podfile, inside the Runner target
use_frameworks! :linkage => :static

3Verify

Clean the Pods folder and install again.

cd ios
rm -rf Pods Podfile.lock
pod install

Confirmed by firebase.google.com

Did this fix it?

How do I stop it coming back?

  • When you add a pod, read the first lines of the pod install output; module problems are reported there, not at compile time.
  • Pick one linkage style (modular headers or use_frameworks!) and keep it in the Podfile under version control.
  • If a library must stay static, Firebase says some libraries cannot be linked dynamically; check its linkage page before choosing dynamic.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Xcode cannot find GoogleService-Info.plist for the Runner target

error: Build input file cannot be found: '/Users/GoogleService-Info.plist' (in target 'Runner' from project 'Runner')

Xcode's project file lists GoogleService-Info.plist as an input, but nothing exists at the path it records.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.