iosfluttermobileadsgoogle-mobile-ads

Flutter iOS Build Fails with "Undefined Symbols" Error When Adding google_mobile_ads Plugin


I’m trying to integrate the google_mobile_ads plugin into my Flutter project, but the iOS build fails during the linking phase with the following error:

Error (Xcode): Undefined symbols: Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

The build works fine without the google_mobile_ads plugin, but as soon as I add it to my pubspec.yaml, the build fails. Here’s what I’ve tried so far:

Environment

Flutter Version: 3.27.1

Dart Version: 3.5.3

CocoaPods Version: 1.16.2

google_mobile_ads Version: 5.2.0

platform :ios, '14.0'

Steps Taken

  1. Updated Podfile:
  1. Verified Info.plist:
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx</string>
  1. Linked Frameworks in Xcode:
  1. Cleaned and Rebuilt:
  1. Reinstalled CocoaPods:

Solution

  • You need to either upgrade Xcode to 15.3+ or downgrade google_mobile_ads to 5.1.0

    If downgrading, make sure to clean Flutter and reinstall pods afterwards.

    See https://github.com/googleads/googleads-mobile-flutter/issues/1185