Need help - removing ads and ads out of nowhere

I have two problems:

  • on one of my tablets when I start my game a sudden full-screen ad appears and redirects me to Google Play - is it posibble that it is a malicious ad from another game (this tablet has a lot, a lot of garbage installed)? Or is mopub/mmedia SDK showing that (that would be horrible)?

  • that game has an option to remove all ads which I do that way:

public void removeAds()
			viewAmazonAds = false;
			amazonAdEnabled = false;
			amazonAdView = null;
			adView = null;
			mAdView = null;
		viewAds = false;

After that no ad should appear (although the activities for that ad networks are still running I suppose, I don’t know how to stop them). Yet - some people are reporting seeing (rarely but still) banners. Especially an ad for audible (do you know which network shows it right now?).

That game uses:

  • mopub markeplace (banner),
  • mmedia (banner),
  • admob (interstitial and banner),
  • appbrain (exit ad),
  • amazon ads (banner).

removeAds is definitely called (since there is no space for ads reserved according to users complaints) - and since I set viewAds to false even before any ads are loaded there shouldn’t even be any views yet to remove - so how did they appear? :frowning:

Any help will be appreciated.

Hello Magnesus, I would tend to think this is another app that has some malicious ad / almost virus, displaying you this ad.
Could you try to isolate it by uninstalling the last few apps you have installed on this device?
Good luck, hope it helps

Right now I have to wait and tomorrow check if it shows up in other apps on that tablet - since it seems to show once a day only.

Are you 100% sure that there are no showAd() / loadAd() calls being made even before you set viewAds to false? How are you determining if removeAds() should be called?

Well, I check with a cached value before anything else starts and then set the viewAds to false. Once it is set to false no function can set it to true during the whole gameplay (although now that I think of it I will have to check what happens on resume, but it should be fine to). The ads appear only sometimes, only to a few users and they appear suddenly during the game, not at the start of the game (from what I gather). Also it always seems to be the same ad (at least for one user - ad for audible).

It might happen that the cache doesn’t work for some reason (well, it’s protected with a control sum which might not work), then the ads would appear until Google Play is contacted to confirm and the removal would happen later in the game - but other indicators described by the users (that the ads are covering part of the game - which can only happen if viewAds is false because I then don’t leave space for ads) suggest it is set to false from the beginning. :frowning: I can’t reproduce it on my devices which makes it really frustrating.

I think I have solved the issue. It was a Java problem caused by me doing a bad refactoring :slight_smile: - I had mAdView defined in my class that was overriding mAdView in a parent class by mistake - and in some cases it led to me removing only one of those mAdViews causing the ads to stay even though they shouldn’t be visible.