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
-
Create a Flutter module.
-
Add the following dependency:
google_maps_flutter: ^2.14.2 -
Run the command:
flutter build ios-framework –output=../FlutterFrameworks -
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.