iOS framework build fails with google_maps_flutter ^2.14.2 when running flutter build ios-framework

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

Expected Behavior

The command should successfully generate the Flutter iOS frameworks and compile all plugin frameworks, including google_maps_flutter.

Actual Behavior

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)

Steps to Reproduce

  1. Create a Flutter module.
  2. Add the following dependency:
    google_maps_flutter: ^2.14.2
  3. Run the command:
    flutter build ios-framework --output=../FlutterFrameworks
  4. Observe the build failure during plugin compilation.

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

  • The issue occurs only when generating iOS frameworks.
  • Android builds successfully with the same dependency.
  • The error occurs during the FlutterPluginRegistrant compilation phase.

Any guidance or suggested workaround would be appreciated.

did you try flutter clean and flutter pub cache clean?

I don’t have much experience with iOS, maybe there are other cleanup steps you can do. For example I had some plugin registrant issue with android the other, I had to delete my .gradle folder to fix it, the clean commands didn’t help.

1 Like

@mihalycsaba , Yes, I have tried all possible solution like flutter clean. In fact I have tried by creating fresh POC project as well, But did not help at all.