I'm always excited to take on new projects and collaborate with innovative minds.

Website

Nsour

Address

Russia, Smolensk

Social Links

Web Development

The Night Flutter and CocoaPods Declared War: How One iOS Build Broke 40+ Plugins — And How I Finally Fixed It

A real-world debugging story of how a Flutter iOS build suddenly collapsed with hundreds of CocoaPods plugin errors — caused not by Xcode or Flutter itself, but by a single set of outdated package versions. This post explains exactly what happened, why it happened, and how forcing correct package versions restored the entire build ecosystem.

The Night Flutter and CocoaPods Declared War: How One iOS Build Broke 40+ Plugins — And How I Finally Fixed It

Shipping a Flutter app to the App Store should be simple: build, archive, upload.
But sometimes Flutter decides to test your patience — and CocoaPods joins the fight.

Recently, I spent nearly two full weeks trying to fix a catastrophic iOS build failure in a production Flutter app. The error logs showed hundreds of warnings across 40+ plugins, dozens of deprecations, constant evaluation errors, Swift warnings, and deployment target mismatches.

At first glance, it looked like the entire project was broken.
In reality, the problem came from one unexpected place:

Outdated Flutter package versions that poisoned the entire CocoaPods dependency graph.

Not Xcode.
Not Flutter SDK.
Not url_launcher specifically.
The package versions themselves.


The Build Collapse

Xcode displayed the classic:

BUILD FAILED

But the real disaster was in the logs.

Examples:

  • Deprecated keyWindow calls inside printing and share_plus

  • Deprecated CoreTelephony APIs inside permission_handler

  • Swift type conversion warnings

  • Firebase internal warnings

  • Deployment targets inside Pods set to iOS 9.0

And then the fatal error that actually killed the build:

 
Error: Constant evaluation error: const _fontWeightToFilenameWeightParts = {

This error came from Google Fonts, but Google Fonts was not the root cause — it simply broke first.


Why Everything Broke at Once

The project originally used older Flutter plugin versions.
When Flutter was upgraded — plugin by plugin — the dependency tree became inconsistent:

  • Some plugins required modern Swift

  • Others still depended on deprecated APIs

  • Some Pods still declared iOS 9 or 10 as their deployment target

  • Several packages were incompatible with the newer Flutter toolchain

  • CocoaPods tied all of them together and failed during the build

The result?

A chain reaction where one outdated package caused every plugin to explode with warnings and errors.


The Real Fix

After trying everything imaginable:

  • Reinstalling Pods

  • Updating Pod repo

  • Running pod deintegrate

  • Fixing deployment targets

  • Editing Info.plist

  • Rebuilding Runner.xcworkspace

  • Cleaning DerivedData

  • Cleaning Flutter cache

  • Crying a little

Nothing worked.

The breakthrough came when I manually inspected the package versions and discovered that some of them were not fully compatible with the updated Flutter version.

The solution was to override specific package versions explicitly.

In pubspec.yaml:

 
dependency_overrides:  url_launcher: 6.3.1  url_launcher_ios: 6.3.5 

But the important point is:

📌 It was NOT url_launcher specifically —

📌 It was the entire set of outdated package versions causing CocoaPods to collapse.

Upgrading this group of packages forced the whole dependency tree into a compatible state.

Then run:

 
flutter clean rm -rf ios/Flutter flutter pub get

And just like that…

🚀 The project compiled.

🚀 The archive succeeded.

🚀 The App Store upload completed without errors.


Why Overriding Package Versions Works

Flutter plugins depend on each other in subtle ways:

  • If one plugin uses old Swift code → it blocks others.

  • If one plugin declares iOS 9.0 → Pods complain loudly.

  • If one plugin uses a deprecated API → build fails for all.

  • If package versions mismatch Flutter SDK → kernel snapshot crashes.

By forcing specific package versions, you clean up:

  • The Swift API compatibility

  • The deployment targets

  • The Podspec metadata

  • The internal linking across Flutter plugins

This stabilizes CocoaPods and restores the entire iOS build pipeline.


Final Thoughts

This issue taught me a simple but powerful rule:

When Flutter iOS builds start failing everywhere, don’t blame Xcode first.
Don’t blame Flutter first.
Blame mismatched Flutter plugin versions.

Outdated or incompatible packages can silently poison the entire CocoaPods environment — and the symptoms appear everywhere.

Once you fix the package versions at the source, everything else falls back into place.

If you ever face similar chaos, start by checking:

  • Your Flutter SDK version

  • Your plugin versions

  • Your Pod deployment targets

And apply overrides where necessary.

It might save you two weeks of debugging.

3 min read
Dec 08, 2025
By Wared Nsour
Share

Leave a comment

Your email address will not be published. Required fields are marked *

Related posts

Nov 11, 2025 • 4 min read
Unit Testing vs Manual Testing vs External Automation — What I Learned Building SmartCardJo

When your system handles money, “it works” isn’t enough. In this artic...

Your experience on this site will be improved by allowing cookies. Cookie Policy