swiftxcodeadmobswift-package-manager

Can not load dependency from Swift Package


I made a package that depends on GoogleMobileAds. I used to add my package as dependency on my apps and it used to load GoogleMobileAds. Something changed now and I observe this behaviour:

When I navigate to target --> Frameworks, Libraries, and Embedded Content, I can not find GoogleMobileAds there..

Here is my Package.swift

let package = Package(
    name: "MikrasyaLibraryAds",
    platforms: [.iOS(.v15)],
    products: [
        .library(
            name: "MikrasyaLibraryAds",
            targets: ["MikrasyaLibraryAds"]),
    ],
    dependencies: [
        .package(url: "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", branch: "main"),
    ],
    targets: [
        .target(
            name: "MikrasyaLibraryAds",
            dependencies: [ .product(name: "GoogleMobileAds", package: "swift-package-manager-google-mobile-ads"),
                          ]
        ),
    ]
)

Edit 1: Here is the build message:

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][399](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.marketplace(MarketplaceKit.AppDistributor.Type) -> (Swift.String) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.other(MarketplaceKit.AppDistributor.Type) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][399](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][399](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][399](GADMarketplaceKitSignals.o)
  enum case for MarketplaceKit.AppDistributor.appStore(MarketplaceKit.AppDistributor.Type) -> MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
  type metadata accessor for MarketplaceKit.AppDistributor, referenced from:
      l007 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
      l008 in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
  nominal type descriptor for MarketplaceKit.AppDistributor, referenced from:
      _symbolic _____Sg 14MarketplaceKit14AppDistributorO in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_GoogleMobileAds in GoogleMobileAds[arm64][399](GADMarketplaceKitSignals.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Other observations:

Thank you.


Solution

  • It seems this issue started with AdMob SDK version 11.6.0. Before that it works just fine.. So, some change in Admob SDK is causing this issue..

    For now, we will use 11.5.0 and hope it will be fixed in upcoming revisions.