Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[google_maps_flutter] Swift Compiler Error: Unable to find module dependency 'GoogleMaps' on Flutter 3.41.2 (Works on older Flutter) #183107

@bharat314

Description

@bharat314

Steps to reproduce

  1. Upgrade Flutter to 3.41.2
  2. Run flutter clean
  3. Remove ios/Pods and Podfile.lock
  4. Run flutter pub get
  5. cd ios && pod install --repo-update
  6. Run flutter run --flavor staging (or any flavor)
  7. Build fails on iOS simulator

Expected results

The project should build successfully on iOS simulator as it does on previous Flutter versions.
Google Maps should compile and link correctly without Swift module errors.

Actual results

Build fails with Swift Compiler Error:

Unable to find module dependency: 'GoogleMaps'
import GoogleMaps
^
/ios/Runner/AppDelegate.swift:1:7

The same project builds successfully when downgrading Flutter to the previous version.

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: GoogleMap(
          initialCameraPosition: CameraPosition(
            target: LatLng(23.0225, 72.5714),
            zoom: 14,
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
Swift Compiler Error (Xcode): Unable to find module dependency: 'GoogleMaps'
import GoogleMaps
       ^
/ios/Runner/AppDelegate.swift:1:7

Could not build the application for the simulator.
Error launching application on iPhone 16e.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.41.2, on macOS 26.3 25D125 darwin-arm64, locale en-IN) [596ms]
    • Flutter version 3.41.2 on channel stable at /Users/user/Projects/flutter_sdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90673a4eef (11 days ago), 2026-02-18 13:54:59 -0800
    • Engine revision 6c0baaebf7
    • Dart version 3.11.0
    • DevTools version 2.54.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [2.2s]
    • Android SDK at /Users/user/Library/Android/sdk
    • Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • ANDROID_HOME = /Users/user/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.9+-14649483-b1163.86)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,305ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    • CocoaPods version 1.16.2

[✓] Network resources [1,111ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions