Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question XCode 15 Unity Build Fail because of AdMob - linker error

Discussion in 'iOS and tvOS' started by korotaevnikita73, Oct 16, 2023.

  1. korotaevnikita73

    korotaevnikita73

    Joined:
    Dec 24, 2017
    Posts:
    26
    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:eek: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

    screen1.png screeeen2.jpg screeen3.jpg screeen4.jpg
     
  2. korotaevnikita73

    korotaevnikita73

    Joined:
    Dec 24, 2017
    Posts:
    26
    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.
     
    LittleArchGames likes this.