使用 CocoaPods 在 swift 中添加 google_mobile_ads sdk 后出错

问题描述 投票:0回答:1

我在我的 swift 项目中添加了 google_mobile_ads sdk v11.6.0。现在,当我运行项目时,出现以下错误

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)

当我从 Pod 中删除 google_mobile_ads SDK 时,一切正常

ios swift cocoa cocoapods google-mobile-ads
1个回答
0
投票

我也遇到了同样的错误,我通过强制安装AdMob 11.0版本解决了它。

通过在 Podfile 中指定: “Google-Mobile-Ads-SDK”、“Google-Mobile-Ads-SDK”窗格中的“11.0”。

安装11.0版本后,出现错误“Sandbox: bash(72986) Deny(1)”。 我通过将“构建设置”中的“用户脚本沙盒”参数设置为“否”来消除它。

一切顺利。

P.S 也许你可以使用比 11.0 更新的版本,但我没有检查过。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.