问题
When trying to play Vungle ads, I'm always getting the message Ad unavailable: No cached or streaming ad available
from the method onAdUnavailable()
What's puzzling me is that it used to work and now it doesn't. It still works on devices where the old version of my app is installed, but when I build it now, it just says ads are unavailable.
I'm implementing Vungle as per their very basic instructions:
final VunglePub vunglePub = VunglePub.getInstance();
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vunglePub.init(this, APP_ID);
vunglePub.setEventListener(vungleListener);
}
private final EventListener vungleListener = new EventListener() {
@Override
public void onVideoView(boolean isCompletedView, int watchedMillis, int videoDurationMillis) {
// Called each time a video completes. isCompletedView is true if the video was not skipped.
}
@Override
public void onAdStart() {
// Called before playing an ad
}
@Override
public void onAdEnd() {
// Called when the user leaves the ad and control is returned to your application
}
@Override
public void onCachedAdAvailable() {
// I don't get this any more
Log.i("vungle","cachedAdAvail");
}
@Override
public void onAdUnavailable(String arg0) {
//I get this when I try to play the ad
Log.i("vungle","Ad unavailable: "+arg0);
}
};
public void playVungleAd() {
vunglePub.playAd();
}
APP_ID
is correct (when I use an incorrect id, I get a specific error), and internet connection is available on the device (AdMob interstitial ads work properly as well as internet in general).
I don't know what to try any more, I'm out of ideas.
回答1:
Looks like you're on one of the new versions of our SDK (3.x). There are a few things you can check:
Make sure you include our service in your manifest, https://github.com/Vungle/vungle-resources/blob/master/Android-resources/android-dev-guide.md#3-update-androidmanifestxml
If you've recently upgraded to version 3.1.0 (or higher), there are some additional steps required, https://github.com/Vungle/vungle-resources/blob/master/Android-resources/android-dev-guide.md#additional-steps-for-sdk-version-310-or-higher
I know you say you have the correct AppID, but just to be sure, use the one in red in the upper left of your app's page on the dash (not the reporting API ID)
If you're still having issues, feel free to email us at tech-support@vungle.com!
来源:https://stackoverflow.com/questions/24998128/vungle-ads-not-available