googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
340 stars 284 forks source link

Error (Xcode): Undefined symbols, After upgrading from version 5.1.0 to 5.2.0 #1185

Closed devchenli closed 1 week ago

devchenli commented 1 week ago

After upgrading from version 5.1.0 to 5.2.0, a issue occurred: the iOS project failed to compile directly.

The error message is: Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update

After I run this command : pod deintegrate and pod install --repo-update, and build iOS project, and another issue occurred:

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

Plugin Version 5.2.0

+8 ms] Failed to build iOS app [ +2 ms] Error (Xcode): Undefined symbols: [ +1 ms] Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation) [ +1 ms] Could not build the application for the simulator. [ ] Error launching application on iPhone 15. [ +1 ms] "flutter run" took 43,652ms. [ +3 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:874:9) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1408:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:420:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5) #8 run.. (package:flutter_tools/runner.dart:130:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #10 main (package:flutter_tools/executable.dart:93:3)

After repeatedly comparing the original project with the updated one, I found that the issue lies in the Other Linker Flags option under the Build Settings of the iOS project. When updated to version 5.2.0, an additional flag "Google_Mobile_Ads_SDK" appears, while in version 5.1.0, it was only "GoogleMobileAds" without the "Google_Mobile_Ads_SDK" flag.

peterweb2005 commented 1 week ago

https://github.com/AppLovin/AppLovin-MAX-SDK-iOS/issues/339 the issue closed statement: The only solutions for this are to upgrade to Xcode 15.3+ or downgrade the Google and Meta adapters

edit

https://developers.google.com/admob/ios/rel-notes

11.6.0 | 2024-06-17 | Added a dependency on MarketplaceKit. This requires apps to build with Xcode 15.3 or above.

11.6.0 2024-06-17
Added a dependency on MarketplaceKit. This requires apps to build with Xcode 15.3 or above.

malandr2 commented 1 week ago

Plugin version 5.2.0 uses iOS Google Mobile Ads SDK [11.10.0](https://developers.google.com/admob/ios/rel-notes) which requires >= Xcode 15.3. Updating your Xcode should resolve the issue.

devchenli commented 1 week ago

Updating the XCode version can solve this issue. Thank you guys.

peterweb2005 commented 1 week ago

so, my solution was to downgrade GMA iOS to 11.5.0, seems ok few days