Skip to content

fix(v2): iOS xcodebuild compile fails — 'MobileAds in scope' (pre-existing, blocks TestFlight) #102

Closed

Description

@wei18

Symptom

xcodebuild -workspace Sudoku.xcworkspace -scheme Sudoku -destination 'generic/platform=iOS' build fails:

Packages/AppMonetizationKit/Sources/AdsAdMob/LiveAdMobBridge.swift:37:13: error: cannot find 'MobileAds' in scope
Packages/AppMonetizationKit/Sources/AdsAdMob/UMPConsentPresenter.swift:88:56: error: generic parameter 'Component' could not be inferred
Packages/AppMonetizationKit/Sources/AdsAdMob/UMPConsentPresenter.swift:97:13: error: cannot find 'ConsentForm' in scope

Reproduces on main (verified by stashing #101 changes — same failure).

Pre-existing scope

Bug existed before #101 (macOS conditional fix). v2.0/v2.1/v2.2 PRs all verified via mise exec -- swift build — host = macOS = canImport(GoogleMobileAds) returns false → bridge body skipped → "passes". No one tested iOS xcodebuild compile before now.

Xcode Cloud builds couldn't catch this either because earlier CI fixes (#76/#87/#89/#93/#95/#98/#100) were sequentially unblocking pre-compile steps. The compile step never ran successfully on iOS.

Symbols in question

  • MobileAds.shared — v11+ AdMob entry point. In v11 the type was renamed from GADMobileAds to MobileAds. The SDK pin says 11.13.0 per Packages/SudokuKit/Package.resolved.
  • ConsentForm — UMP SDK type, recent rename from UMPConsentForm.

Likely causes (to investigate)

  1. Module name mismatch: internal import GoogleMobileAds may need to be import GoogleMobileAds (drop internal) for Tuist+xcodebuild to pick up symbols
  2. Tuist's InternalImportsByDefault interaction: SWIFT_UPCOMING_FEATURE_INTERNAL_IMPORTS_BY_DEFAULT may make Tuist generated project hide AdMob symbols differently than SwiftPM
  3. Module re-export: GoogleMobileAds 11.x may require explicit import GoogleMobileAds.MobileAds or similar
  4. SDK version drift: maybe 11.13.0's symbol layout differs from what the code expects

Acceptance

Investigation steps

  1. grep -A 5 "import.*GoogleMobileAds\|import.*UserMessagingPlatform" Packages/AppMonetizationKit/Sources/AdsAdMob/*.swift
  2. Check if SwiftPM-direct iOS compile (with proper -target/-sdk) works
  3. Try removing internal from import GoogleMobileAds to test InternalImportsByDefault interaction
  4. Check GoogleMobileAds 11.13.0 actual module layout (downloaded SPM artifacts at ~/.cache/DerivedData/...)

Blocks

  • v2.5 TestFlight (Xcode Cloud build will hit this once it reaches compile step)

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