Search code examples
androidandroid-studiomopubvast

MoPub cannot find com.mopub.mobileads.VastVideoInterstitial


I have integrated the full SDK from MoPub, including copying over the necessary adapters into the source for my MoPub module.

However, when I request an ad from MoPub, I keep getting an error:

Couldn't locate or instantiate custom event: com.mopub.mobileads.VastVideoInterstitial.

The problem is that VastVideoInterstitial is most definitely included, so I am baffled as to why MoPub cannot find it. My AndroidManifext.xml includes all the activities I could find for the MoPub module:

    <activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
    <activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
    <activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation|screenSize"/>
    <activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
    <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
    <activity android:name="com.millennialmedia.android.MMActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation|keyboard" />
    <activity android:name="com.millennialmedia.android.VideoPlayer" android:configChanges="keyboardHidden|orientation|keyboard" />
    <activity android:name="com.mopub.mobileads.BaseVideoPlayerActivity"  android:configChanges="keyboardHidden|orientation|keyboard" />
    <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

What am I missing here to show VAST video interstitials? I could turn them off in MoPub, but this seems to be a poor option as it would cause the eCPM for my app to drop.

How can I solve this issue in Android?


Solution

  • I solved this using the old standby of Clean and Rebuild in Android Studio.

    MoPub seems to be generating some odd errors recently in AS. We've only been able to solve these errors by a combination of:

    • Clean and rebuild
    • Restart AS
    • Restart the machine