Integrate early access builds of Google Mobile Ads SDK into Unity apps

  • This guide explains how to integrate an early access build of Google Mobile Ads SDK into a Unity app.

  • Prerequisites include integrating the GMA Unity plugin and having early access builds provided by your account manager.

  • Integration instructions are provided separately for Android and iOS platforms.

  • For Android, you need to download the early access SDK, add its location as a custom Maven repository, and update the GoogleMobileAdsDependencies.xml file.

  • For iOS, you need to ensure the dependencies XML file has no references to the Google-Mobile-Ads-SDK CocoaPod, remove existing copies of the SDK, and place the extracted early access SDK contents in the Assets/Plugins/iOS directory.

This guide is intended for publishers integrating an early access build of Google Mobile Ads SDK into their Unity app. Early access builds provide the opportunity to take advantage of latest Google Mobile Ads SDK features without waiting for the next release, and they're fully tested and meet the same criteria for release as public builds.

Follow the steps on this page to integrate the early access build of Google Mobile Ads SDK into your Unity app.

Prerequisites

  • Follow the Get started guide to integrate the GMA Unity plugin into your Unity project.

  • Early access builds of Google Mobile Ads SDK provided by your account manager.

Integration instructions

Click a tab to select instructions for either Android or iOS. If you're integrating early access builds for both platforms, complete the instructions on both tabs.

Android

Download the early access build of the Google Mobile Ads Android SDK and extract it somewhere convenient.

Next, add this location as a custom Maven repository for the Google Mobile Ads Unity plugin.

Update the dependencies XML file

Update the contents of the XML file at Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml to the following:

<dependencies>
  <androidPackages>
    <androidPackage spec="com.google.android.gms:play-services-ads:x.y.z">
      <repositories>
        <repository>/path/to/extracted/maven/repo</repository>
        <repository>https://maven.google.com/</repository>
      </repositories>
    </androidPackage>
  </androidPackages>
</dependencies>

The bolded text, /path/to/extracted/maven/repo, must be replaced with the path to the archived content of the early access Google Mobile Ads SDK zip file. The dependency version, shown by x.y.z in the previous snippet, can be determined by finding the latest version present under the com/google/android/gms/play-services-ads/ directory in the extracted contents of the Early Access Google Mobile Ads Android SDK zip file.

Force dependency resolution

In the Unity editor, select Assets > Play Services Resolver > Android Resolver > Force Resolve. The Unity Play Services Resolver library then performs dependency resolution from scratch and copy the declared dependencies into the Assets/Plugins/Android directory of your Unity app.

Force resolve

When you build your app, the JAR resolver then runs and imports all required dependencies into the build.

iOS

Make sure that the dependencies XML file at Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml has no references to the Google-Mobile-Ads-SDK CocoaPod.

Next, remove any existing copies of the GoogleMobileAdsSDK that the JAR resolver has placed in your Assets/Plugins/iOS folder.

Download the early access build of the Google Mobile Ads iOS SDK and place its extracted contents in the Assets/Plugins/iOS directory of your Unity project.

When you build your app, it copies the framework to the iOS project.