Repository navigation
[google_maps_flutter] iOS framework build fails: Module 'GoogleMapsUtilsObjC' not found #183441
Description
Activity
- marked [google_maps_flutter_ios] does not build with flutter build ios-framework after v2.17.2 #183533 as a duplicate of this issue
on Mar 11, 2026 - changed the title
[-]iOS framework build fails with google_maps_flutter ^2.14.2 when running flutter build ios-framework[/-][+][google_maps_flutter] iOS framework build fails: `Module 'GoogleMapsUtilsObjC' not found`[/+]on Mar 11, 2026 From the duplicate, the relevant verbose error logging is:
~/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.18.0/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/GoogleMapsUtilsTrampoline.h:11:9: error: Module 'GoogleMapsUtilsObjC' not found (in target 'FlutterPluginRegistrant' from project 'Pods') ~/repos/ios_framework_example/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m:10:9: note: while building module 'google_maps_flutter_ios' imported from ~/repos/ios_framework_example/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m:10: ~/repos/ios_framework_example/.ios/Pods/<module-includes>:1:9: note: in file included from <module-includes>:1: ~/repos/ios_framework_example/.ios/Pods/Target Support Files/google_maps_flutter_ios/google_maps_flutter_ios-umbrella.h:17:9: note: in file included from ~/repos/ios_framework_example/.ios/Pods/Target Support Files/google_maps_flutter_ios/google_maps_flutter_ios-umbrella.h:17: ~/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.18.0/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/FGMClusterManagersController.h:9:9: note: in file included from ~/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.18.0/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/include/google_maps_flutter_ios/FGMClusterManagersController.h:9: ~/repos/ios_framework_example/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m:10:9: error: Could not build module 'google_maps_flutter_ios' (in target 'FlutterPluginRegistrant' from project 'Pods')GoogleMapsUtilsTrampoline.h:11:9: error: Module 'GoogleMapsUtilsObjC' not foundmeans that it's compiling with the wrong configuration;FGM_USING_COCOAPODS=1is defined in the podspec, which should put us on the other codepath:// 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
@vashworth since you've been looking at these build paths in general recently, any idea why we wouldn't be getting that define for this build mode?
(For
google_maps_flutter_ioswe could switch this to not have the ifdef, since it can only compile via CP, but that wouldn't help the _sdk* variants.)- addedplatform-iosiOS applications specificallyiOS applications specificallyp: mapsGoogle Maps pluginGoogle Maps pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-iosOwned by iOS platform teamOwned by iOS platform team
on Mar 11, 2026 - addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work listtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
on Mar 12, 2026 Hi team,
Is there any update or tentative timeline for this issue?
This issue is currently blocking our iOS release pipeline. The Android platform works fine with the “add-to-app” approach, but the issue occurs on iOS.
At the moment, we are not in a position to change our project architecture or migrate to a different Maps SDK, so we would really appreciate any guidance or a potential workaround.
If there is any temporary solution, workaround, or a branch with a potential fix that we could try, please let us know so we can unblock our production pipeline.
We are currently affected in our production workflow and would be happy to help test a fix if needed.
Thanks for all the work on Flutter!
@email2sunilverma As a temporary workaround you can for
google_maps_flutter_iosand makeGoogleMapsUtilsTrampoline.hunconditionally includeGoogleMapsUtilsinstead of having a conditional. That would make it not work with Swift Package Manager, but will fix your CocoaPods build.Okay so this appears to only happen for Flutter modules (aka
flutter create --template module).When we build the CocoaPods plugins into XCFrameworks, we build all targets of the
PodsXcode project:flutter/packages/flutter_tools/lib/src/commands/build_ios_framework.dart
Lines 856 to 873 in 5e1be56
var pluginsBuildCommand = <String>[ ...globals.xcode!.xcrunCommand(), 'xcodebuild', '-alltargets', '-sdk', XcodeSdk.IPhoneOS.platformName, '-configuration', xcodeBuildConfiguration, 'SYMROOT=${iPhoneBuildOutput.path}', 'ONLY_ACTIVE_ARCH=NO', // No device targeted, so build all valid architectures. 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES', if (boolArg('static')) 'MACH_O_TYPE=staticlib', ]; RunResult buildPluginsResult = await globals.processUtils.run( pluginsBuildCommand, workingDirectory: project.ios.hostAppRoot.childDirectory('Pods').path, ); And in a Flutter module, we create a
FlutterPluginRegistrantpod, which has a dependency on each plugin:flutter/packages/flutter_tools/lib/src/flutter_plugins.dart
Lines 560 to 586 in 5e1be56
const _pluginRegistrantPodspecTemplate = ''' # # Generated file, do not edit. # Pod::Spec.new do |s| s.name = 'FlutterPluginRegistrant' s.version = '0.0.1' s.summary = 'Registers plugins with your Flutter app' s.description = <<-DESC Depends on all your plugins, and provides a function to register them. DESC s.homepage = 'https://flutter.dev' s.license = { :type => 'BSD' } s.author = { 'Flutter Dev Team' => '[email protected]' } s.{{os}}.deployment_target = '{{deploymentTarget}}' s.source_files = "Classes", "Classes/**/*.{h,m}" s.source = { :path => '.' } s.public_header_files = './Classes/**/*.h' s.static_framework = true s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.dependency '{{framework}}' {{#methodChannelPlugins}} s.dependency '{{name}}' {{/methodChannelPlugins}} end '''; It's the building of this pod that is failing. I'm guessing that because GoogleMaps is a static framework that it gets compiled into the
FlutterPluginRegistrantbinary, but because it's not the GoogleMaps target, it's not passing theFGM_USING_COCOAPODSGCC_PREPROCESSOR_DEFINITIONS.@stuartmorgan-g Perhaps we could use the
SWIFT_PACKAGEpreprocessor macro instead of the customFGM_USING_COCOAPODS? It's unclear to me if that would pass through when built statically, though, so we need to test it. We could also add the macro on the SwiftPM side and see if that works. There's also theCOCOAPODS=1macro that's part of CocoaPods, but again we'd need to test how that passes through when it's built staticallyI carried that structure over from the original WIP PR that tried to add SwiftPM support and didn't think much about it. Now I'm wondering if we could just use
#if __has_includeinstead.We could probably also get rid of the static framework directive; I doubt the original reason still applies in a module-based world.
Ahh yes,
#if __has_includewould probably be betterIt seems like it may not work with modules unfortunately. Let's start with switching to COCOAPODS and see if that works; it's a simplification over the current approach regardless.
It seems like it may not work with modules unfortunately. Let's start with switching to COCOAPODS and see if that works; it's a simplification over the current approach regardless.
Why wouldn't it work? Couldn't you do:
#if __has_include(<GoogleMapsUtils/GoogleMapsUtils.h>) @import GoogleMapsUtils; #else @import GoogleMapsUtilsObjC; #endifCapturing from experimentation and offline discussion:
- It's still not clear to me why, but I can't successfully gate
GoogleMapsUtilsObjCimports on a__has_includeof one of its headers. I tried with<GoogleMapsUtilsObjC/GoogleMapsUtilsObjC.h>(thinking that should be generated, but it's not clear that it is) and with<GoogleMapsUtilsObjC/GMUCluster.h>. Maybe SwiftPM module builds just can't be checked via__has_include? (It has to be done this way, not with the#iftargeting CocoaPods builds, because the SwiftPM build has both of these modules, but the things we need are in theObjCversion, which in turn depends onGoogleMapsUtilsin its Swift.package) - Using
COCOAPODSdoesn't work because it is set at the Runner level, so messes up builds that use SwiftPM for Google Maps, but CocoaPods for another non-SwiftPM-supporting dependency. - Using
SWIFT_PACKAGEdidn't seem to work in SwiftPM builds for some reason.
For now the plan is to do what I said at the end of this comment and make the
google_maps_flutter_iosheader unconditional. That will limit the breakage to just the combination of A2A + CocoaPods + explicitly opting intogoogle_maps_flutter_ios_sdkN, which isn't a combination that I would expect anyone to actually need to use.- It's still not clear to me why, but I can't successfully gate
I have used the below commit version from the : branch:commits
google_maps_flutter:
git:
url: https://github.com/flutter/packages.git
ref: 0066b77ea703881c5a22f05633a796ea7b9c4b82
path: packages/google_maps_flutter/google_maps_flutterbut this is again failing to generate the iOS .xcframework, below is the complete error logs:
`google_map_demo % flutter build ios-framework --no-debug --no-profile --output=../FlutterFrameworks
Building frameworks for com.d.waveptxmodule in release
mode...
├─Copying Flutter.xcframework... 225ms
├─Building App.xcframework...
Font asset "MaterialIcons-Regular.otf" was tree-shaken,
reducing it from 1645184 to 1408 bytes (99.9% reduction).
Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
├─Building App.xcframework...
Font asset "MaterialIcons-Regular.otf" was tree-shaken,
reducing it from 1645184 to 1408 bytes (99.9% reduction).
Tree-shaking can be disabled by providing the
--no-tree-shake-icons flag when building your app.
├─Building App.xcframework... 11.1s
Running pod install... 2,021ms
├─Building plugins... 27.0s
Unable to build plugin frameworks: ** BUILD FAILED **The following build commands failed:
ScanDependencies
/Users/sunilverma/SourceCode/FlutterModuleDemo/FlutterFrame
works/Release/iphoneos/Pods.build/Release-iphoneos/FlutterP
luginRegistrant.build/Objects-normal/arm64/GeneratedPluginR
egistrant.o
/Users/sunilverma/SourceCode/FlutterModuleDemo/google_map_d
emo/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedP
luginRegistrant.m normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler (in target
'FlutterPluginRegistrant' from project 'Pods')
(1 failure)
`Could you please confirm if I’m missing any additional required setup for this commit and module-based ios-framework build?
I have used the below commit version from the : branch:commits
google_maps_flutter: git: url: https://github.com/flutter/packages.git ref: 0066b77ea703881c5a22f05633a796ea7b9c4b82 path: packages/google_maps_flutter/google_maps_flutter
The changes in that branch are to
google_maps_flutter_ios, so this isn't doing anything. If you want to test that branch locally you need to overridegoogle_maps_flutter_iosto pull from the branch.I have used the below commit version from the : branch:commits
google_maps_flutter: git: url: https://github.com/flutter/packages.git ref: 0066b77ea703881c5a22f05633a796ea7b9c4b82 path: packages/google_maps_flutter/google_maps_flutterThe changes in that branch are to
google_maps_flutter_ios, so this isn't doing anything. If you want to test that branch locally you need to overridegoogle_maps_flutter_iosto pull from the branch.In this case how do we verify the changes without any modification in code from our side? is there any branch or tag that can we use and verify the same.
- added a commit that references this issue
on Mar 25, 2026 - added a commit that references this issue
on Mar 26, 2026 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Apr 8, 2026 - added a commit that references this issue
on Jun 10, 2026
Steps to reproduce
I am trying to generate iOS frameworks from a Flutter module using the flutter build ios-framework command. The build fails during the plugin compilation stage when the google_maps_flutter plugin is included.
This issue occurs only for iOS builds. The Android build works correctly with the same configuration.
The failure happens during the FlutterPluginRegistrant build step with a ScanDependencies error referencing GeneratedPluginRegistrant.m.
Dependency
google_maps_flutter: ^2.14.2
Command Used
flutter build ios-framework --output=../FlutterFrameworks
Steps to Reproduce
Environment
Flutter version: 3.41.4 Dart version: 3.11.1 DevTools version: 2.54.1 Xcode version: 26.3 macOS version: 15.7.3 (M1) CocoaPods version: 1.16.2
Additional Notes
Any guidance or suggested workaround would be appreciated.
Expected results
The command should successfully generate the Flutter iOS frameworks and compile all plugin frameworks, including google_maps_flutter.
Actual results
The build fails while compiling plugin frameworks.
Error output:
Unable to build plugin frameworks: ** BUILD FAILED **
The following build commands failed:
ScanDependencies
/Users/.../FlutterFrameworks/Debug/iphoneos/Pods.build/Debug-iphoneos/FlutterPluginRegistrant.build/Objects-normal/arm64/GeneratedPluginRegistrant.o
/Users/.../google_map_demo/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(in target 'FlutterPluginRegistrant' from project 'Pods')
(1 failure)
Code sample
pubspec.yaml
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Flutter Doctor output
Doctor output