Search code examples
androidandroid-studioadmobmopubmillennial-media

How to add the custom event files to MoPub Android SDK?


I'm new to this and I really need your help! I imported the MoPub SDK using Gradle on Android Studio, and I can't figure out how to add the custom event files (Millennial, AdColony) to the project. I tried to add the files to a new directory like the guide says here, but I keep getting the same errors:

Couldn't locate or instantiate custom event: com.mopub.mobileads.MillennialBanner. MoPubErrorCode: Unable to find Native Network or Custom Event adapter.

I tried to create a folder called com.mopub (both under src and project directory) and inside another folder called mobileads and in there I pasted all the files. I tried different combinations but all failed. Here's how I implement the SDK on the app's build.gradle:

compile('com.mopub:mopub-sdk:3.12.0@aar') {
        transitive = true
    }

I'm not using ProGuard.


Solution

  • Got it. Make sure you have all the files in a folder called com.mopub.mobileads and then simply drag and drop this folder under the java folder inside /src/main of Android Studio's Project sidebar.