[Android] Mediation problem - No Fill and then Crash

1,560 views
Skip to first unread message

studentvz20

unread,
Jun 11, 2016, 6:18:43 AM6/11/16
to Google Mobile Ads SDK Developers
Hi,

Few months ago I implemented AdMob mediation for AdColony, ChartBoost, Vungle, UnityAds and Facebook ads in Unity 4.6 without any big problem. I used older AdMob plugin 2.3.1 and older Android SDK.

Now I work in Unity 5.3.4f1, I use Google Mobile Ads 3.0.4. Yesterday I updated all parts of my Android SDK to latest. 

1) I created clean Unity 5 project -> Imported Google Ads Plugin 3.0.4. -> resolved jars -> Tested with test ad unit and it is working great - I receive test ads.

2) Now I want to add AdColony to mediation:

Downloaded latest AdColony Unity Plugin and imported it into my project. Fixed manifest and replaced Ad Unity ID with my mediation one (Ad Unit ID works great on old Unity 4.6 build, so there is no problem with Ad Unity ID). Running app on my device I get: No Fill message every time. I tryed to move adcolony.jar to MobileAds libs folder but then I can't compile because of duplicate files, "dex" error.

I tryed replacing adcolony.jar with adcolony.jar that includes adapter (one that you can get from google android mediation support list) which I used in my Unity 4.6. But still no luck in Unity 5, I'm getting No Fill message and after few seconds my app crashes.

I lost more than 20 hours on this problem and I can't solve it. PLease , if you can test it yourself.

Thank you.



studentvz20

unread,
Jun 11, 2016, 11:31:04 AM6/11/16
to Google Mobile Ads SDK Developers
Solution:

Don't forget to add this piece of code at your app start:
AdColony.Configure(
 
"version:1.0,store:google", // Arbitrary app version and Android app store declaration.
 
"yourappid",   // ADC App ID from adcolony.com
 
"yourzoneid" // A zone ID from adcolony.com
);

I didn't add it in my Unity 5 project because someone on this forums said that nothing needs to be configured, that we just need to import AdColony plugin. 

Import AdColony plugin, replace adcolony.jar with adcolony.jar which includes adapter. Add code mentioned above and that is all.

studentvz20

unread,
Jun 15, 2016, 1:43:03 PM6/15/16
to Google Mobile Ads SDK Developers
I maybe found a bug with adcolony interstitial and reward ad in admob mediation. When you load both Interstitial Adcolony ad, and Adcolony reward ad, if you play reward you will not receive reward, method is not called. If I load any other Interstitial from another Ad network, then Adcolony reward ad is giving reward. Maybe some Adcolony Zone id conflict in sdk.

In AdColony - new app and app id, one zone id for interstitial, one for reward set up to be reward (both in test mode).
In AdMob - two ad unit ids, one for interstitial and one for reward, everything set up as it should be.
In Unity - AdMob mediation set up correctly, works for all other ad networks

I have one gameobject, AdManager that holds script responsible for ads. At start it loads both interstitial and reward ads. When I need one of them in my game I call it from another script. 

I can provide log and script on private because log have my ad ids.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jun 15, 2016, 4:45:38 PM6/15/16
to Google Mobile Ads SDK Developers
Hi there,

Thank you for the details and I was able to reproduce the issue here. It's interesting, however, that AdColony is serving CVC ads for both Interstitials and Reward Ads. 

Thanks,
Veer Busani
Mobile Ads SDK Team

studentvz20

unread,
Aug 10, 2016, 7:32:31 AM8/10/16
to Google Mobile Ads SDK Developers
Hi,

Two months have passed, is this maybe fixed now?

Thanks.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 10, 2016, 11:49:02 AM8/10/16
to Google Mobile Ads SDK Developers
Hi there,

I was unable to reproduce this issue with the latest adaptor. I would suggest you to try with the latest version and if it still fails, then let us know and we would contact AdColony to get this fixed. Alternatively, you can directly contact AdColony as well to let them know of this issue.


Thanks,
Veer Busani
Mobile Ads SDK Team

studentvz20

unread,
Jan 20, 2017, 4:57:45 AM1/20/17
to Google Mobile Ads SDK Developers
I have implemented new Google Mobile Ads Unity plugin and new Adcolony SDK than includes adapter. Now it gives a reward but there are some new strange problems. Just for info, Chartboost and Unity ads work without any problem, and I use only test ads.

I do very detailed testing, like 10-20 requests and shows of ads (both interstitial and reward). Sometimes I receive No Fill, most of the time for requestin reward ad but sometimes even for interstital. Maybe Adcolony can't fill every request (what would be strange for test ads) and I could accept that but there are some other strange problems.

Case1: Sometimes after No Fill for Reward ad It won't show Interstital that was loaded, I need to request it again and then it will show it. (I run app for first time, interstitial and reward got loaded at the same time, I show reward and after is done I request new one but I get No Fill, then I try to show already loaded interstitial but it does not want to show it and I need to request a new one).
Case2: Sometimes Iterstital is loaded, but it won't show after click and requesting a new one is not helping. Like it is stuck and I need to restart app.
Case3: Very rare, when I want to show loaded reward ad it doesn't show it, it just throws no fill and then happens Case2. 
Case4: I only get No Fill for reward ad for few minutes or longer, even if I restart app. I have sent email about this to Adcolony, maybe they limit number of reward test ads per hour...

 I suspect that there is still some conflict betwen interstitial and reward ad that ocurs now and then. It is a bit hard to reproduce but it is happening.

I could send you my sample app.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 20, 2017, 11:08:05 AM1/20/17
to Google Mobile Ads SDK Developers
Hi there,

Thank you for reaching out to us. A sample app that would reproduce this issue would certainly be helpful. But before we start, are you using Third Party Network's settings to load your Reward Amount or setting it natively via AdMob. I would suggest you to use the native setting to load the reward amount to ensure that it would be sent as part of the ad request. For the remaining queries, a sample app would certainly be helpful but make sure that you are not making multiple ad requests simultaneously. Like an Interstitial and Reward Video ads at the same time. Make one ad request at a time and see if that fixes the issue.

Also, for no fills, you must contact the ad network directly to get this resolved as there would be nothing much that we can do about it. 

Thanks,
Arjun Busani
Mobile Ads SDK Team

studentvz20

unread,
Jan 21, 2017, 12:21:30 PM1/21/17
to Google Mobile Ads SDK Developers
Hi Arjun,

I'm using native AdMob mediation reward setting to load the reward amount, Third Party is turned off. There is no problem with geting reward. 

I make requests for Interstitial and Reward Video ads at the same time (simultaneously) only at app start. Infact, both requests are not triggered at the same time, one is in Awake() and another in Start(). Can I ask why this is bad? They are different type of "objects", they should not interfer and any other ad network does not have any problems with this. 

I have a gameobject with attached script that persist across all my game app, from start to moment when user exits app. This object is my ad manager, it loads interstitial and reward ads, show it when I want it and after ad close it loads another ad which is prepared for next show. What would be the best way to implement ads? Because I need to have ad already prepared for show, most of my users are from regions where they have very bad internet connection and ad loading can take a long time.

In my menu I give users a option to watch ad for reward, also at one point in my menu I show interstitial ad. In gameplay after crash or after restart I also show interstitial ad.

Basic structure of my AdManager (without additional checks and outside connections):
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using GoogleMobileAds;
using GoogleMobileAds.Api;

public class AdManagerObject : MonoBehaviour {

public static AdManagerObject instance;

private InterstitialAd interstitial;
private RewardBasedVideoAd rewardBasedVideo;

void Awake () {

if (!instance) {
instance = this;
} else {
Destroy (this.gameObject);
}

DontDestroyOnLoad(this.gameObject) ;

// Get singleton reward based video ad reference.
rewardBasedVideo = RewardBasedVideoAd.Instance;

// RewardBasedVideoAd is a singleton, so handlers should only be registered once.
rewardBasedVideo.OnAdLoaded += HandleRewardBasedVideoLoaded;
rewardBasedVideo.OnAdFailedToLoad += HandleRewardBasedVideoFailedToLoad;
rewardBasedVideo.OnAdStarted += HandleRewardBasedVideoStarted;
rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded;
rewardBasedVideo.OnAdClosed += HandleRewardBasedVideoClosed;

RequestRewardBasedVideo();

}

void Start(){
RequestInterstitial ();

}

public void RequestInterstitial(){

interstitial = new InterstitialAd ("YOUR_INTER_ID");
interstitial.OnAdLoaded += HandleAdLoaded;
interstitial.OnAdFailedToLoad += HandleAdFailedToLoad;
interstitial.OnAdClosed += HandleAdClosed;

AdRequest request1 = new AdRequest.Builder ().Build ();
interstitial.LoadAd (request1);

}

public void RequestRewardBasedVideo()
{
if (!rewardBasedVideo.IsLoaded()){
string adUnitId = "YOUR_REWARD_ID";

AdRequest request2 = new AdRequest.Builder().Build();
rewardBasedVideo.LoadAd(request2, adUnitId);
}

}
void HandleAdLoaded (object sender, System.EventArgs e)
{
}
void HandleAdFailedToLoad (object sender, AdFailedToLoadEventArgs e)
{
}

void HandleAdClosed (object sender, System.EventArgs e)
{
interstitial.Destroy ();
interstitial.OnAdLoaded -= HandleAdLoaded;
interstitial.OnAdFailedToLoad -= HandleAdFailedToLoad;
interstitial.OnAdClosed -= HandleAdClosed;
RequestInterstitial ();
}

public void HandleRewardBasedVideoLoaded(object sender, EventArgs args)
{
}

public void HandleRewardBasedVideoFailedToLoad(object sender, AdFailedToLoadEventArgs args)
{
}

public void HandleRewardBasedVideoStarted(object sender, EventArgs args)
{
}

public void HandleRewardBasedVideoClosed(object sender, EventArgs args)
{
RequestRewardBasedVideo();
}

public void HandleRewardBasedVideoRewarded(object sender, Reward args)
{
string type = args.Type;
int amount = (int) args.Amount;
}

public void ShowInterstitialAd(){
if (interstitial.IsLoaded ()) {
interstitial.Show ();
}
}

public void ShowRewardAd(){
if (rewardBasedVideo.IsLoaded()){
rewardBasedVideo.Show();
}
}

void OnDestroy(){
interstitial.Destroy ();
}
}


Also, I would like to know do I need to destroy interstitial everytime like I'm doing it at this moment, or I can simply just request new one like for rewardvideoads?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 23, 2017, 10:47:13 AM1/23/17
to Google Mobile Ads SDK Developers
Hi there,

Start and Awake are relatively close lifecycle callbacks and I would suggest instead that you wait for either one of the ad to be to loaded and then make another one. If it still does not work, you can give us a sample app that would reproduce this issue and we will be able to look into it.

Thanks,
Arjun Busani
Mobile Ads SDK Team

studentvz20

unread,
Jan 23, 2017, 2:45:04 PM1/23/17
to Google Mobile Ads SDK Developers
Hi,

It didn't help.

Steps (after ads are loaded): Show interstitial, show reward, show interstitial (after this show you will get no fill), try to show reward (that is loaded) but it will not show it. Test it, you should get no fills and be unable to show loaded ad.

Is there some private way to send you my interstitial and reward admob ad unit ids or admob account info?

Thank you.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 23, 2017, 5:01:18 PM1/23/17
to Google Mobile Ads SDK Developers
Hi there,

I was able to consecutively load Reward Video and Interstitials without any issue using your sample app. When it comes to no fills, the fault usually is a serving issue and I would suggest you to recheck your Ad Unit ID(s) settings.

You can also test with my Ad Unit IDs and let us know -

Interstitial: ca-app-pub-6745644712123529/9980783695
Reward Video: ca-app-pub-6745644712123529/5380930499

You can reply to me privately if you want to share your Ad Unit IDs for us to look into.

Thanks,
Arjun Busani
Mobile Ads SDK Team

studentvz20

unread,
Jan 23, 2017, 6:22:45 PM1/23/17
to Google Mobile Ads SDK Developers
Hi,

Strange problems like not to be able to show loaded ad apears when you use AdColony Interstitial and Adcolony Reward. Could you test with both Adcolony interstitial and reward video using pattern for few times that I mentioned in my previous post? Because your interstitials are from AdMob and they are also live ads.

Regarding no fills, using your ad IDs, after showing reward video few times I eventualy got no fill and I needed to manually request a new one. My internet connection and wifi connection are flawles.

I'm afraid that I don't have option to reply you privately (to post author), I don't know why.

Sorry for bothering you, easiest thing would be simply not to use Adcolony reward video when I use Adcolony interstitial but I'm courious to identify a problem.

Thank you.

studentvz20

unread,
Jan 29, 2017, 6:37:30 AM1/29/17
to Google Mobile Ads SDK Developers
Hi,

Any news about this?

Thank you.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 30, 2017, 10:39:35 AM1/30/17
to Google Mobile Ads SDK Developers
Hi there,

I'm guessing that you are using an older version of AdColony's SDK. Make sure that you are using the latest one and then try again. Also, don't request AdColony Interstitial ads when requesting for Reward Video Ads. I can send you an email, to which you can respond back with your Ad Unit ID.

Thanks,
Arjun Busani
Mobile Ads SDK Team

studentvz20

unread,
Feb 8, 2017, 3:16:38 PM2/8/17
to Google Mobile Ads SDK Developers
I'm using latest AdColony SDK, I have contacted AdColony team and they managed to reproduce a problem. The problem is still with multiple Zone ids because AdColony relies on AdColony.Configure() call, which can't be done in Unity from my experience. I decided to remove AdColony reward ads to remove problem mentioned above. 

But now I found another problem, especially with an AdColony interstitial. My game over screen has Restart button. When I press restart button I want to show Interstitial ad. If ad is loaded it will show ad and when ad is closed OnClose will fire my loading screen and scene restart, but if ad is not loaded it will immediately activate loading screen and then restart scene. Now, if there is any failure at ads side my user could be stuck with a frozen loading screen. 

1) With AdColony
Load Interstitial ad -> Turn off wifi and mobile data -> Try to show that loaded interstitial. It will return true for IsLoaded() but it will not show ad, and because of that OnClose event will not be fired (which I need to restart the level). So my users have stuck loading screen at this point and game is like frozen.

2) With other networks Interstitial ads
Load Interstitial ad -> Turn off wifi and mobile data -> Show Ad and ad will be shown. Also, OnClose will be fired when I close the ad and my game restart is triggered. Everything is as expected, but, if I turn back on wifi and mobile data I will get only No Fill for some time, and as I found out the only game exit and new start helps.

Could you explain above-mentioned problems? 

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Feb 8, 2017, 5:26:34 PM2/8/17
to Google Mobile Ads SDK Developers
Hi there,

1) With AdColony

This sounds like an issue with the AdColony's adaptor, which is part of their own SDK. Let me look into this and update you. 

2) With other networks Interstitial ads

I was not able to reproduce this issue on my end. Can you send me an APK that does and I would look into it?

Thanks,
Arjun Busani
Mobile Ads SDK Team

studentvz20

unread,
Feb 9, 2017, 7:52:24 AM2/9/17
to Google Mobile Ads SDK Developers
Hi,

1) Adcolony
AdColony support agent confirmed me this and explained that this is expected behaviour of their ads, that advertisers wanted this, connection is required to play ad. So, in other words, if users internet connection snaps you are stuck with a loaded ad, that can't be played and OnClose event will not be triggered, using OnClose is a big risk.

I could just call my scene restart immediately when I show an ad and that would bypass almost all possible internal problems regarding ads. But, some ads have display delay, like Vungle who has 1-2 second delay of displaying already loaded ad, what is a complete nonsense. My restarted game is ready to start and then Vungle displays ad because of delay, very stupid. While AdMob, AdColony, Chartboost don't have this delay problem.

2) Other Networks
I noticed that Vungle is ok so maybe other networks ads are also ok. Chartboost has No Fill problem. If you could test only Chartboost you should be able to reproduce it.

Send me an email on "myusername"@gmail.com

Thank you.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Feb 9, 2017, 3:07:20 PM2/9/17
to Google Mobile Ads SDK Developers
Hi there,

Let me send you an email and I would be able to look into this further. I was not able to reproduce no fills with Charboost and I might be missing something. Always first only enable test ads and then move onto live one's. Again, we would not be able to assist you in case of no fills by a third party mediation ad network. It might just be due to some ad serving restrictions and I would suggest you to email Chartboost about this. 

Thanks,
Arjun Busani
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages