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
Added pod 'Google-Mobile-Ads-SDK', '~> 11.10.0'.
Set the platform to ios, '14.0'.
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx</string>
Added GoogleMobileAds.framework to Frameworks, Libraries, and Embedded Content.
Set GoogleMobileAds.framework to Embed & Sign.
Deleted Podfile.lock and Pods/ directory.
Run pod install --repo-update.
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