Resolve iOS mediation runtime errors

If you encounter dynamic linker errors after app launch, you might encounter the following runtime errors:

  • dylib
  • dynamic framework
  • Library not loaded
  • no such file

To resolve these errors, link these frameworks statically. This guide covers how to build the Unity application for iOS, link these frameworks, and find dependencies for different adapter versions.

Prerequisites

Before continuing, complete Get started.

The following mediation ad sources SDKs require linking statically:

  • AppLovin
  • InMobi
  • maio

To link a mediation ad source SDK statically, do the following:

  1. Create an Assets/GoogleMobileAds/Editor/iOSDynamicDependencies.xml file.
  2. Add a dependencies/iosPods/iosPod element for each framework.
  3. In the iosPod element include a addToAllTargets attribute with a value of true.
<dependencies>
  <iosPods>
    <!-- AppLovin adapter dependencies. -->
    <iosPod name="AppLovinSDK" version="13.1.0" addToAllTargets="true"/>
    <!-- InMobi adapter dependencies. -->
    <iosPod name="InMobiSDK" version="10.8.0" addToAllTargets="true"/>
    <!-- maio adapter dependencies. -->
    <iosPod name="MaioSDK-v2" version="2.1.6" addToAllTargets="true"/>
  </iosPods>
</dependencies>

Find dependencies for different adapter versions

To find dependencies for a different adapter version, do the following:

  1. Select the sample podspec for the adapter you want to update:

  2. Open the podspec for the adapter version your project uses.

  3. Update iosPod dependency to match the version listed in the dependencies key of the podspec.