Skip to content

GoogleDataTransport duplicate symbols when Firebase is resolved via Swift Package Manager #866

@gabriel-primesw

Description

@gabriel-primesw

Describe your issue. If applicable, add screenshots to help explain your problem.

Building for iOS device fails with 175 duplicate symbols and a linker error when the project uses any google_mlkit_* package alongside Firebase Flutter plugins (firebase_core, firebase_crashlytics, etc.) on Flutter with Swift Package Manager enabled.

Error (Xcode): 175 duplicate symbols
Error (Xcode): Linker command failed with exit code 1

google_mlkit_commons depends on MLKitCommon (> 14.0.0) via CocoaPods, which in turn depends on GoogleDataTransport (> 10.0). At the same time, Firebase Flutter plugins (≥ v4.x for firebase_core) now resolve through Swift Package Manager, and the Firebase iOS SDK SPM package also includes GoogleDataTransport. This results in GoogleDataTransport being linked twice — once via CocoaPods and once via SPM — causing ~175 duplicate symbol errors at link time.

Dependency chain:

CocoaPods: google_mlkit_commons → MLKitCommon 14.0.0 → GoogleDataTransport 10.1.0
SPM: firebase_core ^4.7.0 → firebase-ios-sdk 12.13.0 → googledatatransport 10.1.0

Steps to reproduce.

Create a Flutter project using any google_mlkit_* package (e.g. google_mlkit_barcode_scanning, google_mlkit_face_detection) alongside firebase_core ^4.x.
Ensure Flutter's Swift Package Manager integration is enabled (default on recent Flutter versions).
Run flutter build ios or build for a physical device in Xcode.

What is the expected result?

The project builds successfully without duplicate symbol errors.

Actual behavior

Build fails with 175 duplicate symbols for GoogleDataTransport.

Did you try our example app?

Yes

Is it reproducible in the example app?

Yes

Reproducible in which OS?

iOS

Flutter/Dart Version?

Flutter 3.44.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 559ffa3f75 (5 days ago) • 2026-05-15 14:13:13 -0700
Engine • hash fcf463a2242790d1fdcd9d044f533080f5022e18 (revision 4c525dac5e) (4 days ago) • 2026-05-15 19:00:04.000Z
Tools • Dart 3.12.0 • DevTools 2.57.0

Plugin Version?

google_mlkit_commons: 0.11.1
google_mlkit_barcode_scanning: 0.14.2
google_mlkit_face_detection: 0.13.2
firebase_core: ^4.7.0
firebase_crashlytics: ^5.2.0
MLKitCommon (CocoaPod): 14.0.0
GoogleDataTransport (CocoaPod): 10.1.0
GoogleDataTransport (SPM, via firebase-ios-sdk): 10.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions