解决 iOS 中介运行时错误
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如果您在应用启动后遇到动态链接器错误,则可能会遇到以下运行时错误:
dylib
dynamic framework
Library not loaded
no such file
如需解决这些错误,请以静态方式链接这些框架。本指南介绍了如何针对 iOS 构建 Unity 应用,并链接这些框架。
前提条件
在继续之前,请先通读入门指南。
以静态方式链接框架
下表列出了具有动态框架的广告来源,以及可自动处理静态链接的最低适配器版本。如需以静态方式链接框架,请将适配器更新为以下最低版本或更高版本:
如需使用不会自动配置静态链接的旧版适配器,请执行以下操作:
创建一个包含以下内容的 Assets/GoogleMobileAds/Editor/iOSDynamicDependencies.xml
文件:
<dependencies>
<iosPods>
<!-- AppLovin adapter dependencies. -->
<iosPod name="AppLovinSDK" addToAllTargets="true"/>
<!-- InMobi adapter dependencies. -->
<iosPod name="InMobiSDK" addToAllTargets="true"/>
<!-- maio adapter dependencies. -->
<iosPod name="MaioSDK-v2" addToAllTargets="true"/>
</iosPods>
</dependencies>
仅保留适用于您应用的广告来源的 <iosPod>
元素。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-18。
[null,null,["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Resolve iOS mediation runtime errors\n\nIf you encounter dynamic linker errors after app launch, you might encounter\nthe following runtime errors:\n\n- `dylib`\n- `dynamic framework`\n- `Library not loaded`\n- `no such file`\n\nTo resolve these errors, link these frameworks statically. This guide covers how\nto build the Unity application for iOS and link these frameworks.\n\nPrerequisites\n-------------\n\nBefore continuing, complete [Get started](/admob/unity/quick-start).\n\nLink frameworks statically\n--------------------------\n\nThe following table lists ad sources with dynamic frameworks and the minimum\nadapter version that automatically handles static linking. To link frameworks\nstatically, update your adapters to the following minimum version or higher:\n\n| Ad source | Minimum version for automatic static linking |\n|-----------|--------------------------------------------------------|\n| AppLovin | [8.1.1](/admob/unity/mediation/applovin#version-8.1.1) |\n| InMobi | [4.7.1](/admob/unity/mediation/inmobi#version-4.7.1) |\n| maio | [3.0.0](/admob/unity/mediation/maio#version-3.0.0) |\n\n### Manually configure static linking\n\nTo use an older adapter version that doesn't automatically configure static\nlinking, do the following:\n\n1. Create an `Assets/GoogleMobileAds/Editor/iOSDynamicDependencies.xml` file\n with the following content:\n\n \u003cdependencies\u003e\n \u003ciosPods\u003e\n \u003c!-- AppLovin adapter dependencies. --\u003e\n \u003ciosPod name=\"AppLovinSDK\" addToAllTargets=\"true\"/\u003e\n \u003c!-- InMobi adapter dependencies. --\u003e\n \u003ciosPod name=\"InMobiSDK\" addToAllTargets=\"true\"/\u003e\n \u003c!-- maio adapter dependencies. --\u003e\n \u003ciosPod name=\"MaioSDK-v2\" addToAllTargets=\"true\"/\u003e\n \u003c/iosPods\u003e\n \u003c/dependencies\u003e\n\n2. Keep only the `\u003ciosPod\u003e` elements for ad sources that apply to your app."]]