You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[packages] Warnings in Swift code aren't caught in CI #194517
The repo tool analyze command is supposed to fail on warnings, which has allowed us to keep our code warning-free, and in particular to find deprecated code in advance of it becoming a problem using the *-min-version flags in CI.
Except we wrote that tooling when all of the code was Obj-C, so GCC_TREAT_WARNINGS_AS_ERRORS was all we needed. But GCC_TREAT_WARNINGS_AS_ERRORS doesn't apply to Swift, so we've been silently losing warning coverage in CI as we ported plugins to Swift 🤦
I haven't tried yet, but hopefully we just need to add SWIFT_TREAT_WARNINGS_AS_ERRORS to that command to restore things. Doing so is going to require fixing all the latent warnings that have been introduced though, so it will probably be non-trivial.
Activity
stuartmorgan commentedon Oct 16, 2026
flutter/packages#13284 has a trial run. There are quite a few failing packages, but from spot checking a lot of them are just one or two warnings.
It looks like the tricky part will be the instances of
In particular, it looks like passing it on the command line is applying it to external dependencies, which causes problems:
The tooling may need to add this to individual Xcode targets instead of passing it as an argument, but that would be significantly more complicated.
jmagman commentedon Oct 16, 2026
r'SWIFT_TREAT_WARNINGS_AS_ERRORS=$(SWIFT_SUPPRESS_WARNINGS:not)'worked: flutter/packages#13284 (comment)jmagman commentedon Oct 16, 2026
Fixing this is blocked on resolving all the newly surfaced errors:
initWithDocumentTypes:inMode:is deprecated #128713allowedFileTypesmacOS 12 deprecation warnings #194573webView(forIdentifier:withPluginRegistry:)deprecation warnings #194585AVKeyValueStatuscheck)[google_maps_flutter_ios] Use 'let' for unmutated var (#13300)
[image_picker_ios] Fix Swift warnings in ImagePickerPluginTests (#13299)
[pointer_interceptor_ios] Use 'let' for unmutated var (#13297)
[camera_avfoundation] Fixes sendability mismatch in completion handler (
[file_selector_ios] Drop deprecated UIDocumentPickerMode code path (#…
[webview_flutter_wkwebview] Require iOS 15 / macOS 12 and drop deprec…
[camera_avfoundation] Fix Swift analyzer issue _captureSessionQueue (#…
[in_app_purchase_storekit] Suppress StoreKit 1 deprecation warnings (#…
[file_selector_macos] Drop deprecated allowedFileTypes code path (#13302
[camera_avfoundation] Fix Swift analyzer issues in tests (#13340)