Error after adding google_mobile_ads sdk in swift using CocoaPods
Asked Answered
C

3

5

I added the google_mobile_ads sdk v11.6.0 in my swift project. Now when I run the project I get the following error

ld: warning: Could not find or use auto-linked library 'swiftXPC': library 'swiftXPC' not found
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: warning: Could not find or use auto-linked framework 'MarketplaceKit': framework 'MarketplaceKit' not found
ld: Undefined symbols:
  enum case for MarketplaceKit.AppDistributor.testFlight(MarketplaceKit.AppDistributor.Type) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.marketplace(MarketplaceKit.AppDistributor.Type) -> (Swift.String) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.other(MarketplaceKit.AppDistributor.Type) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  static MarketplaceKit.AppDistributor.current.getter : MarketplaceKit.AppDistributor, referenced from:
      function signature specialization <Arg[0] = Dead> of static GoogleMobileAds.GADMarketplaceKitSignals.appDistributor() async -> Swift.String in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  async function pointer to static MarketplaceKit.AppDistributor.current.getter : MarketplaceKit.AppDistributor, referenced from:
      function signature specialization <Arg[0] = Dead> of static GoogleMobileAds.GADMarketplaceKitSignals.appDistributor() async -> Swift.String in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.appStore(MarketplaceKit.AppDistributor.Type) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  type metadata accessor for MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  nominal type descriptor for MarketplaceKit.AppDistributor, referenced from:
      _symbolic _____Sg 14MarketplaceKit14AppDistributorO in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_GoogleMobileAds in GoogleMobileAds[arm64][423](GADMarketplaceKitSignals.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

when I remove google_mobile_ads SDK from pods everything works fine

Corneille answered 26/6, 2024 at 8:33 Comment(1)
upgrade xcode 15.3 or higher. Or downgrade google mobile ads SDK ver (<=11.5.0)Cucullate
G
9

11.6.0 2024-06-17
Added a dependency on MarketplaceKit. This requires apps to build with Xcode 15.3 or above. MarketplaceKit is Swift-only, so a Swift placeholder file has been added to the distribution so Swift standard libraries are included in apps even if they don't contain other Swift files.

Two solutions.

  1. Use xcode15.3 and above
  2. Specify the fixed version pod 'Google-Mobile-Ads-SDK', '11.5.0'
Gerson answered 3/7, 2024 at 9:41 Comment(2)
Thank you, this saved me after an embarrassing amount of time.Triptych
this did not help me, I am using SPMRemittent
R
4

I had the same error, I solved it by installing version 11.0 of AdMob forcibly.

By specifying in Podfile: Google-Mobile-Ads-SDK', '11.0' in the pod Google-Mobile-Ads-SDK.

After installing version 11.0, there was an error "Sandbox: bash(72986) deny(1)". I eliminated it by setting the

User Script Sandboxing parameter in Build Settings to No.

And everything worked successfully.

P.S Perhaps you can use more recent versions than 11.0, but I have not checked it.

Raddled answered 2/7, 2024 at 12:32 Comment(0)
S
2

Well, I had Xcode 15.2.

Downgrading the SDK to any version lower than 11.5.0 did not help (I tried 11.0, or even went back to 10.14). But with lower versions an app was showing an error that Google-Mobile-Ads-SDK is missing. I tried to deintegrate pods, uninstall the SDK, clean Pod caches, delete derived data, etc. Nothing helped.

After 2 days of juggling back and forth, I decided to download another version of Xcode (15.3), let my app have the latest SDK version (I guess 11.7.0), and all was good, and I wanted to stay on this planet for a bit longer once again.

Just a small side note, if you install an app called Xcodes, you can have multiple Xcode versions 🤷

Here is kind an easy tutorial how to install it: https://testableapple.com/the-easiest-way-to-manage-multiple-xcodes/

Slink answered 30/7, 2024 at 6:47 Comment(1)
I spent 5-6 hours and this is the only solution that worked, thanks. I was also using 15.2, after installing 15.4 it run successfully from the first try.Remittent

© 2022 - 2025 — McMap. All rights reserved.