Okay, I got something working. And I’d like to post my process to hopefully help others that get stuck in the instructions. If some of these things are obviously, more power to you because they were not to me.
FYI: I’m working on a 64bit Windows 8 machine.
here we go:
First instruction on mopub is:
In order to properly build the MoPub Unity Plugin you will need to use files from this repository (referred to as UnityPlugin in this document) and the MoPub Android SDK found under the mopub-sdk directory at https://github.com/mopub/mopub-android-sdk (referred to as MoPubSdk in this document).
so I went over to https://github.com/mopub/mopub-android-sdk and downloaded the “MoPub Android Full SDK.zip”
This page lists a whole set of instructions on getting this sdk install too. What I found is that most of the steps are already done in the provided download. The things you still have to do are:
Eclipse Integration Steps 1-4:
- Import the mopub-sdk archive into
your workspace by clicking File >
Import… and choosing Existing
Projects into Workspace.
- Click the Select Archive File button
then click Browse…
- Select the mopub-sdk archive file.
Then, click Open.
- …then Finish.
Adding the SDK to Your Project Steps 1-2:
- Go to the Eclipse Package Explorer, right-click your project folder and select Properties.
- Choose Android from the sidebar.
- you should find that step 3 cannot be completed
Adding Ad Network Libraries to Your Project: should all be done for you too.
Updating your Android Manifest: needs to be done
.
Now that that’s done, we can go back to the unity plugin stuff:
the first bullet:
-
Build MoPubPlugin.jar
a. Clone MoPubSdk
b. Copy UnityPlugin’s MoPubUnityPlugin.java to MoPubSdk’s src/main/java/com/mopub/mobileads directory
c. Add UnityPlugin’s classes.jar to MoPubSdk’s build path (in Eclipse)
d. Use Eclipse (or your favorite tool) to build the MoPubSdk library to MoPubPlugin.jar
This part is where I initially had the trouble.
(a.) is a given, you download the sdk
(b.) for this step, I found, that it’s best to drag and drop the file on top of the “com.mopub.mobileads” object. This makes sure it gets added in all the right ways.
(c.) similar to step (b.) I prefer to drag and drop the file in the lib folder, then make sure to go into the Java Build Path (under properties) and add it (click add Jars… button, and select it)
(d.) this was a confusing step to me, eventually what I found was I could right click the project and select export, which opened a dialog for me to
select Java/JAR file, Next…
select a export destiation, where I could name the jar the appropriate “MoPubPlugin.jar”, Finish.
The next 4 steps are self explanatory.
- Import UnityPlugin’s MoPubAndroid.unitypackage into your Unity Android Project
- Copy MoPubPlugin.jar to the Unity Project’s Plugins/Android directory
- Copy UnityPlugin’s android-support-v4.jar to the Unity Project’s Plugins/Android directory
- (Optional) Add UnityPlugin’s Plugins/MoPubAndroid/testSupport/MoPubTestScene to the Unity build window (contains the MoPubUIManager.cs example)
- Build and run your Unity project
After that I was able to run the sample project and see the banner ad. That’s as far as I’ve gotten. I hope this helps someone avoid the suffering I’ve faced.
Best
j