Migrate to MoPub Unity Plugin v5.5.0 or Higher

Use this document to migrate to the MoPub Unity Plugin 5.5.x with the SDK Manager.

Because certain MoPub Unity 5.x.x plugin releases are not backward-compatible, publishers upgrading from specific versions must migrate in stages to ensure a successful integration.

Migrating Steps

The steps you take depend on your current version of the MoPub Unity Plugin:

Your Current Version of the MoPub Unity Plugin Steps to Follow
Pre-v5.0.0 1. Migrate to v5.0.0
2. Migrate to v.5.4.0
3. Migrate to v5.5.x
v5.0.0 1. Migrate to v5.4.0
2. Migrate to v5.5.x
v5.4.0 1. Migrate to v5.5.x

Migrating to v5.5.x

In version 5.5.0 of the MoPub Unity Plugin, MoPub introduced the SDK Manager as a new interface to automatically download and install the correct versions of the MoPub SDK, the mediation SDKs, and the associated mediation adapters. The SDK Manager also detects your currently installed versions and prompts you to update any outdated SDKs and adapters.

SDK Manager

To migrate from MoPub Unity Plugin v5.4.0 to v5.5.x, first delete old directories, then simply launch the SDK Manager

Delete Old Directories

The 5.5.0 release of the MoPub Unity plugin introduces the SDK Manager to streamline mediation integration. To use the SDK Manager, publishers must delete old mediation directories first.

  • Delete (Assets/Plugins/Android/mopub-support, Assets/Plugins/iOS/MoPub-Mediation-Adapters), and any other directory where you may have placed existing adapters and SDKs. The Jar Resolver places its downloaded libraries in different directories from where you were previously instructed. Not deleting old directories may cause duplicate class build errors. Simply delete the old MoPub directories and let the SDK Manager to take over future installs and upgrades of network SDKs.

  • For iOS, if you plan to use mediation, remove any existing MoPub iOS SDK framework in Assets/MoPub/Plugins/iOS/MoPubSDKFramework.framework. Doing so allows the SDK Manager to take over and download the MoPub iOS SDK that is bundled with mediation adapters.

Launch the SDK Manager

  1. From the Unity menu bar, select MoPubManage SDKs.

    SDK Manager

  2. Click Install for any mediation network you want to integrate. Doing so downloads the desired network’s .unitypackage archive containing the adapters, as well as the dependencies XML required for the Jar Resolver.

Migrating to v5.4.0

The 5.4.0 release of the MoPub Unity plugin internally reorganizes the directory and file structure (see below for the detailed breakdown). When you upgrade from v5.0.0 to v5.4.0, the plugin automatically detects if there are legacy directories or files in the existing project. Simply navigate to the MoPub menu, open SDK Manager and you should see a Migrate button if your project needs a cleanup.

Note that the migration operation is irreversible. Make sure that you have backed up your project before launching the migration task. Performing the migration is optional: it simply moves all MoPub code to the same directory. Whether or not the operation is triggered does not have any adverse effect on your project or integration.

Unity Native

Unity Native

Unity Native

Automatically Migrated Files

The following files and directories are automatically migrated by the migration task:

Legacy Location New Location
MoPub/Extras/ DELETED (redundant content)
MoPub/Editor MoPub/Scripts/Editor
MoPub/Internal MoPub/Scripts/Internal
MoPub/ThirdParty MoPub/Scripts/ThirdParty
MoPub/MoPub.cs MoPub/Scripts/MoPub.cs
MoPub/MoPubManager.cs MoPub/Scripts/MoPubManager.cs
MoPub/mopub-dark-logo.png MoPub/Sample/mopub-dark-logo.png
Scenes/MoPubDemoScene.unity MoPub/Sample/MoPubDemoScene.unity
Scripts/GravityController.cs MoPub/Sample/GravityController.cs
Scripts/MoPubDemoGUI.cs MoPub/Sample/MoPubDemoGUI.cs
Scripts/MoPubEventListener.cs MoPub/Sample/MoPubEventListener.cs
Plugins/Android/README.txt MoPub/Plugins/Android/MoPub.plugin/README.txt
Plugins/Android/mopub MoPub/Plugins/Android/MoPub.plugin
Plugins/iOS/MoPubBinding.m MoPub/Plugins/iOS/MoPubBinding.m
Plugins/iOS/MoPubManager.h MoPub/Plugins/iOS/MoPubManager.h
Plugins/iOS/MoPubManager.mm MoPub/Plugins/iOS/MoPubManager.mm
Plugins/iOS/MoPubSDKFramework.framework MoPub/Plugins/iOS/MoPubSDKFramework.framework

Files You Should Review and Manually Migrate

The files under unity-sample-app/Assets cannot be automatically migrated, so we recommend that you review them and migrate them manually if you wish. If publishers have not modified them so they’re still just MoPub code, these files can be moved to the new location:

Legacy Location New Location
Plugins/Android/res/drawable/ic_launcher_foreground.png MoPub/Plugins/Android/MoPub.plugin/res/drawable/
Plugins/Android/res/drawable-anydpi-v26/app_icon.xml MoPub/Plugins/Android/MoPub.plugin/res/drawable-anydpi-v26/
Plugins/Android/res/values/ic_launcher_background.xml MoPub/Plugins/Android/MoPub.plugin/res/values/

Unity Native

Files Excluded from Migration

The files under the following directories are currently not handled by the migration task. They are subject to change in a future Unity plugin release:

Legacy Location New Location
Plugins/Android/mopub-support/* MoPub/Plugins/Android/MoPub.plugin/

Migrating to v5.0.0

To upgrade from any version of the MoPub SDK prior to 5.0.0, follow the steps outlined in our SDK Initialization and GDPR documents.

Last updated March 08, 2019

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2019 MoPub (a division of Twitter, Inc.)