You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity集成Admob后Xcode编译出现Apple Mach-O Linker (id)错误求助

Hey there, let's work through this Apple Mach-O Linker error you're facing after integrating AdMob into your Unity project and exporting to Xcode. I've debugged plenty of these issues before, so here are the most actionable fixes to try out:

Key Troubleshooting & Fix Steps
  • Verify all required frameworks are included
    AdMob doesn't work with just the main GoogleMobileAds.framework—you need to add its dependencies too. Make sure these are in your Xcode project's frameworks directory:

    • AdSupport.framework
    • AppTrackingTransparency.framework
    • CoreTelephony.framework
    • SystemConfiguration.framework
      Plus, don't forget the two required libraries: libsqlite3.tbd and libz.tbd. Unity exports sometimes miss these, so manually adding them can resolve missing symbol errors.
  • Check framework embedding settings
    In Xcode, select your project target, go to the General tab, and scroll to Frameworks, Libraries, and Embedded Content. Set all AdMob-related frameworks to Embed & Sign instead of Do Not Embed. If they're set to the latter, the linker won't be able to resolve the necessary symbols at build time.

  • Audit Unity's iOS export settings
    Misconfigured Unity settings can cause conflicts in the exported Xcode project. Head to Unity's Player Settings > iOS > Other Settings and check:

    • Ensure Scripting Backend is set to IL2CPP (AdMob has better compatibility with IL2CPP than Mono for iOS)
    • Confirm Architecture is set to ARM64 (Apple no longer supports 32-bit iOS apps)
    • If Strip Engine Code is enabled, try disabling it—this feature can accidentally strip code AdMob needs. Re-export the project after changing this.
  • Clean Xcode's build cache
    Stale cache is a common culprit for linker errors. Do the following:

    1. Go to Product > Clean Build Folder (use the shortcut Cmd+Shift+K)
    2. Delete Xcode's Derived Data: Open Xcode > Preferences > Locations, click the arrow next to the Derived Data path, and delete the entire folder for your project
    3. Rebuild the project from scratch
  • Ensure version compatibility between Unity plugin and SDK
    If you manually added the AdMob framework to Xcode, it might conflict with the version included in your Unity AdMob plugin. Instead of manual framework addition, use Unity's Package Manager to install the official AdMob plugin—it automatically handles framework dependencies during Xcode export, eliminating version mismatch issues.

  • Remove duplicate framework references
    Sometimes Unity's export process already adds the AdMob framework, and manual addition creates duplicates. Check your Xcode project's Frameworks directory for multiple copies of GoogleMobileAds.framework and delete the extra one.

内容的提问来源于stack exchange,提问作者dubstepteam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:40:42