Skip to content

fix(ios): silence third-party pod warnings in the Xcode Cloud archive - #1191

Merged
anhappdev merged 1 commit into
masterfrom
fix/ios-pod-build-warnings
Oct 27, 2026
Merged

anhappdev merged 1 commit into
masterfrom
fix/ios-pod-build-warnings

Conversation

@anhappdev

Copy link
Copy Markdown
Collaborator

Problem

The Xcode Cloud "Deploy to TestFlight | Archive - iOS" run reports about 30 warnings on every build (31 on #1160 and #1164, 29 on #1190). None of them come from our code:

  • About 13 linker warnings Search path '.../Metal.xctoolchain/usr/lib/swift/iphoneos' not found, one per Swift pod plus the app.
  • About 15 compiler warnings in Flutter plugin sources under .pub-cache: firebase_auth (deprecated APIs, unused variables, keyWindow), firebase_core (pointer types), firebase_storage (non-exhaustive switch, retroactive Error conformance), share_plus (keyWindow), device_info_plus (integer precision).
  • libtool: warning: 'dummy.o' has no symbols.

Cause

CocoaPods adds "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" to every Swift pod's LIBRARY_SEARCH_PATHS, and the url_launcher_ios and shared_preferences_foundation podspecs add $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/, which also reaches Pods-Runner. On Xcode Cloud the Metal toolchain comes first in TOOLCHAINS, so TOOLCHAIN_DIR points into Metal.xctoolchain. That toolchain has no usr/lib/swift, so every link step warns.

Change

In flutter/ios/Podfile post_install:

  • Remove the $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) entry (either spelling, and the old DT_TOOLCHAIN_DIR form) from the pod xcconfigs. The app targets iOS 15, which ships the Swift runtime in /usr/lib/swift, and /usr/lib/swift and $(SDKROOT)/usr/lib/swift stay in the search paths. This replaces the Xcode 15 DT_TOOLCHAIN_DIR → TOOLCHAIN_DIR rewrite, which no podspec here needs any more.
  • Set GCC_WARN_INHIBIT_ALL_WARNINGS and SWIFT_SUPPRESS_WARNINGS on pod targets. CocoaPods' inhibit_all_warnings! only covers Objective-C files, so it would leave the firebase_storage Swift warnings.

Only third-party pod targets are affected. Warnings in our own Runner code still show up.

Verification

Local builds of the Pods-Runner target (all plugin and Firebase pods, -sdk iphoneos, Release, Xcode 26.6, CocoaPods 1.17.0). The Metal toolchain is installed and put first in TOOLCHAINS to match Xcode Cloud, which makes TOOLCHAIN_DIR point into Metal.xctoolchain there too:

Podfile TOOLCHAINS Result Warnings
master Metal first (like Xcode Cloud) BUILD SUCCEEDED 29: 12 search path ... Metal.xctoolchain ... not found, 15 plugin warnings, dummy.o, Crashlytics duplicate -lc++
this PR Metal first (like Xcode Cloud) BUILD SUCCEEDED 0
this PR default BUILD SUCCEEDED 0

The full app link (Runner plus the bazel-built backends) wasn't built locally. The Xcode Cloud archive on this PR is the end-to-end check.

Every Xcode Cloud archive reported about 30 warnings, none from our code:

- Link steps warned "Search path '.../Metal.xctoolchain/usr/lib/swift/iphoneos'
  not found". CocoaPods and some podspecs add
  $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to LIBRARY_SEARCH_PATHS, and on
  Xcode Cloud TOOLCHAIN_DIR resolves to the Metal toolchain. post_install now drops
  that entry. The app targets iOS 15, whose Swift runtime is in /usr/lib/swift.
  This replaces the Xcode 15 DT_TOOLCHAIN_DIR rewrite, which the regex also covers.
- Flutter plugin and Firebase sources (firebase_auth/core/storage, share_plus,
  device_info_plus) warned about deprecations, unused variables and so on. Pod
  targets now set GCC_WARN_INHIBIT_ALL_WARNINGS and SWIFT_SUPPRESS_WARNINGS.
@anhappdev
anhappdev requested a review from a team as a code owner October 26, 2026 05:34
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@sonarqubecloud

Copy link
Copy Markdown

@freedomtan freedomtan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anhappdev
anhappdev merged commit 47bdbc7 into master Oct 27, 2026
51 of 52 checks passed
@anhappdev
anhappdev deleted the fix/ios-pod-build-warnings branch October 27, 2026 05:53
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants