From 0066b77ea703881c5a22f05633a796ea7b9c4b82 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 18 Mar 2026 16:11:33 -0400 Subject: [PATCH 1/2] [google_maps_flutter] Fix A2A iOS builds Unshares `GoogleMapsUtilsTrampoline.h` and makes the `google_maps_flutter_ios` version, which only needs to support CocoaPods, unconditionally use the import version that CocoaPods needs. This works around the fact that (as discussed in the issue) we haven't yet found a way to reliably detect which mode this package is being built in that works in all the edge conditions we tested. `google_maps_flutter_ios_sdk*` will still be broken for A2A CocoaPods builds but: - Someone would have to explicitly opt into that, vs just try to use `google_maps_flutter`. - There is currently no advantage to using an `_sdk*` variant in a CocoaPods build. - Future versions of Flutter will support SwiftPM-based A2A flows. Given that, fixing this only for `google_maps_flutter` may be sufficient even in the long term, in addition to addressing the regression in the short term. Fixes https://github.com/flutter/flutter/issues/183441 --- .../google_maps_flutter_ios/CHANGELOG.md | 4 ++++ .../ios/google_maps_flutter_ios.podspec | 2 -- .../GoogleMapsUtilsTrampoline.h | 7 ------- .../google_maps_flutter_ios/pubspec.yaml | 2 +- .../GoogleMapsUtilsTrampoline.h | 12 ------------ 5 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index 53957aa91377..179691037daf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.18.1 + +* Removes conditional header logic that broke add-to-app builds. + ## 2.18.0 * Adds support for advanced markers. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec index 529c229438cd..d18e53fac837 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec @@ -38,8 +38,6 @@ Downloaded by pub (not CocoaPods). s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', - # To handle the difference in framework names between CocoaPods and Swift Package Manager in shared code. - 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) FGM_USING_COCOAPODS=1', } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.resource_bundles = {'google_maps_flutter_ios_privacy' => ['google_maps_flutter_ios/Sources/google_maps_flutter_ios/Resources/PrivacyInfo.xcprivacy']} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h index cf6399b5b39e..f28daee88163 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h @@ -2,11 +2,4 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// If Swift Package Manager is in use, Objective-C headers are available under the -// GoogleMapsUtilsObjC package. When using CocoaPods, the headers are provided by the -// GoogleMapsUtils package. -#ifdef FGM_USING_COCOAPODS @import GoogleMapsUtils; -#else -@import GoogleMapsUtilsObjC; -#endif diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index 6b01ee3376a9..d8548ac8dac0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.18.0 +version: 2.18.1 environment: sdk: ^3.10.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h deleted file mode 100644 index cf6399b5b39e..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// If Swift Package Manager is in use, Objective-C headers are available under the -// GoogleMapsUtilsObjC package. When using CocoaPods, the headers are provided by the -// GoogleMapsUtils package. -#ifdef FGM_USING_COCOAPODS -@import GoogleMapsUtils; -#else -@import GoogleMapsUtilsObjC; -#endif From c6800bb7a3b736d8aaa2f4f69e61f474f80516db Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 18 Mar 2026 16:22:50 -0400 Subject: [PATCH 2/2] Mark the file as unshared --- .../google_maps_flutter_ios/tool/unshared_source_files.dart | 2 ++ .../tool/unshared_source_files.dart | 2 ++ .../tool/unshared_source_files.dart | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/tool/unshared_source_files.dart b/packages/google_maps_flutter/google_maps_flutter_ios/tool/unshared_source_files.dart index 90d963c64dde..627f7e007ee0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/tool/unshared_source_files.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/tool/unshared_source_files.dart @@ -10,4 +10,6 @@ const intentionallyUnsharedSourceFiles = [ 'test/package_specific_test_import.dart', // Each package will have its own list. 'tool/unshared_source_files.dart', + // Unshared due to https://github.com/flutter/flutter/issues/183441. + 'ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h', ]; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart index 8660b7e6a17e..dee386df465d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart @@ -12,4 +12,6 @@ const intentionallyUnsharedSourceFiles = [ 'test/package_specific_test_import.dart', // Each package will have its own list. 'tool/unshared_source_files.dart', + // Unshared due to https://github.com/flutter/flutter/issues/183441. + 'ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/include/google_maps_flutter_ios_sdk10/GoogleMapsUtilsTrampoline.h', ]; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart index 1cfb85a852ac..7e0205065261 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart @@ -12,4 +12,6 @@ const intentionallyUnsharedSourceFiles = [ 'test/package_specific_test_import.dart', // Each package will have its own list. 'tool/unshared_source_files.dart', + // Unshared due to https://github.com/flutter/flutter/issues/183441. + 'ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/include/google_maps_flutter_ios_sdk9/GoogleMapsUtilsTrampoline.h', ];