XCode 15 Unity Build Fail because of AdMob - linker error

On the final step of uploading my game to App Store, while archiving the project in Xcode 15, my build fails because of the linker error and AdMob undefined symbols reason. There may be something wrong with the unity-plugin-library like on the screenshots.I think Xcode just cant find some files from my projects that are linked with Google AdMob Ads plugin. I got 2 errors and warnings

The error is like this: Unity Framework 2 issues Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation)

ld: Undefined symbols:
_CGSizeFromGADAdSize, referenced from:
+[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _GADAdSizeEqualToSize, referenced from:

  • [GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADAdSizeFromCGSize, referenced from: __GAMUBannerViewSetValidAdSizes in unity-plugin-library.a [arm64][11] (GADUInterface.o)
  • [GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) + [GADUPluginUtil adSizeForWidth: height:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADAdSizeFullWidthPortraitWithHeight, referenced from:
  • [GADUPluginUtil adSizeForWidth: height:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth, referenced from:
  • [GADUPluginUtil adaptiveAdSizeForWidth: orientation:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADErrorUserInfoKeyResponseInfo, referenced from:
    GADUGetAdErrorResponse Info in unity-plugin-library.a[arm64] [11] (GADUInterface.o)
    GADLandscapeAnchored Adaptive BannerAdSizeWithWidth, referenced from:
  • [GADUPluginUtil adaptiveAdSizeForWidth: orientation:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth, referenced from:
  • [GADUPluginUtil adaptiveAdSizeForWidth:hushed:rientation:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _NSValueFromGADAdSize, referenced from:
    _GAMUBannerViewSetValidAdSizes in unity-plugin-library.a[arm64][11] (GADUInterface.o)
    OBJC_CLASS\_GADAppOpenAd, referenced from: in unity-plugin-library.a\[arm64\] \[9\] (GADUAppOpenAd.o) _OBJC_CLASS___GADBannerView, referenced from:
    in unity-plugin-library.a[arm64] [10] (GADUBanner.o)
    OBJC_CLASS\_GADExtras, referenced from: in unity-plugin-library.a\[arm64\] \[15\] (GADURequest.o) _OBJC_CLASS__GADInterstitialAd, referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to add libraries or frameworks in the “Compile Sources” window in Build Phases in Xcode. I tried adding frameworks to “Link binary with Libraries”. I tried adding “$inherited” to properties of one of the files. I tried restarting my Mac and XCode. At first I was building with Google AdMob unity plugin version 8.4.0 and I updated to the latest plugin 8.5.2 but the errors were the same.

My configuration: Unity: 2021.3.31f1
AdMob: 8.5.2
Xcode: 15
MacOS: MacOS 14 latest
BaseSDK: IOS
Architecture: Arm64
Ruby: 3.2.2
CocoaPods: 1.13.0

Errors happened because there was no .xcworkspace generated. I was able to solve this by following this amazing video on youtube:

. After that, you will generate .xcworkspace file and not project one which will solve the errors.

1 Like