This guide is intended for publishers integrating an early access build of the Google Mobile Ads SDK into their Unity app. Early access builds provide the opportunity to take advantage of new 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 the 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:<span class="notranslate">16.7.1</span>">
<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.
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.
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.