Skip to content

[iOS] Google ODM is not available when the plugin is integrated via Swift Package Manager #201

Description

@leonardo-oliveir-a

Summary

Since v5.7.0 the plugin can be integrated on iOS via Swift Package Manager, but Google On-Device Measurement (ODM) is not reachable through that path. The plugin's Package.swift only pulls the AdjustSdk product, and the official ODM guide for Flutter is CocoaPods-only — so apps that use ODM in production cannot move to SPM.

This matters beyond a nice-to-have: Flutter has no per-plugin opt-out for SPM. Once any other dependency in the app requires SPM (Adapty 4.x is SPM-only, Firebase and Sentry are heading the same way), enabling flutter config --enable-swift-package-manager is all-or-nothing — and at that moment ODM silently becomes unavailable.

Current state (as of v5.8.0)

Plugin — ios/adjust_sdk/Package.swift declares a single product:

.target(
  name: "adjust_sdk",
  dependencies: [
    .product(name: "AdjustSdk", package: "ios_sdk"),
  ],
  ...
)

Native iOS SDK — Package.swift does expose the ODM product:

products: [
    .library(name: "AdjustSdk", targets: ["AdjustSdk"]),
    .library(name: "AdjustUnsigned", targets: ["AdjustUnsigned"]),
    .library(name: "AdjustWebBridge", targets: ["AdjustWebBridge", "AdjustSdk"]),
    .library(name: "AdjustGoogleOdm", targets: ["AdjustGoogleOdm", "AdjustSdk"])
],

So the capability exists in ios_sdk; it just isn't wired up in the Flutter plugin.

The official Flutter ODM guide documents only the CocoaPods route:

pod 'Adjust/AdjustGoogleOdm'
pod 'GoogleAdsOnDeviceConversion', '3.0.0'

It makes no mention of SPM.

Why the CocoaPods workaround doesn't survive SPM

Keeping pod 'Adjust/AdjustGoogleOdm' in the Podfile while the plugin comes in via SPM pulls the Adjust SDK through two package managers at once: the AdjustGoogleOdm subspec depends on Adjust/Adjust, which depends on AdjustSignature 5.0.0, while SPM independently builds AdjustSdk + its adjust_signature_sdk dependency. The iOS build then fails with:

Multiple commands produce '.../AdjustSigSdk.framework'

It is also not a matter of dropping the pod sources into the SPM build by hand: Adjust.podspec points the ODM subspec at plugins/odm/sources/cocoapods/*, while the SPM target uses plugins/odm/sources/spm. The two integrations have different sources, so the fix has to come from the plugin side.

Request

Expose the ODM integration to SPM users of the Flutter plugin. Some options, in the order we'd find useful:

  1. Opt-in product / companion plugin — e.g. a separate adjust_sdk_google_odm Flutter plugin (or an additional SPM product) that depends on .product(name: "AdjustGoogleOdm", package: "ios_sdk"), mirroring how the CocoaPods subspec keeps ODM opt-in. This keeps the GoogleAdsOnDeviceConversion dependency off the apps that don't use ODM.
  2. Documentation — at minimum, an SPM section in the Google ODM guide describing a supported way to combine the two, if one already exists that we've missed.

If option 1 is the direction, we're happy to test a branch against a production app that runs ODM today.

Environment

  • adjust_sdk: 5.7.1 / 5.8.0
  • Flutter: 3.44.1
  • Xcode 26, IPHONEOS_DEPLOYMENT_TARGET = 15.0
  • ODM enabled in production via pod 'Adjust/AdjustGoogleOdm'

Related: #189 added generic SPM support, which is what surfaced this gap.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions