skip to Main Content
pod 'Google-Mobile-Ads-SDK'
FirebaseAnalytics/AdIdSupport (8.9.1)
Firebase (8.9.1):
Xcode -Version 12.4 (12D4e)
iPad Simulator -12.9 inch 3rd Generation

There is a Flutter thread on this problem here

I’m having this issue with banner ad testAdID units when rotating on an iPad to landscape.
For example in Portrait the test ad shows and works fine but once I rotate the iPad to landscape I get

Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the ‘Other Linker Flags’ setting of your build target.

The odd thing is once I rotate back to portrait the ad appears.

This process is non-stop. The ad always shows in portrait but nothing shows in landscape with the same above error message

I looked in Target > Build Settings > All > Other Linker Flags and it was already set to Obj-C

enter image description here

code:

// called in ViewDidLoad
func initializeAdMob() {
    
    let adMobKey = "ca-app-pub-3940256099942544/2934735716"
    
    bannerView.adUnitID = adMobKey
    bannerView.rootViewController = self
    bannerView.delegate = self
    
    let adSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(frame.size.width)
    bannerView.adSize = adSize
    
    view.addSubview(bannerView)
    bannerView.heightAnchor.constraint(equalToConstant: 50).isActive = true
    bannerView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
    bannerView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
    bannerView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -15).isActive = true

    bannerView.load(GADRequest())
}

2

Answers


  1. It only seems to happen in test environments.

    I don’t have any issues with my published app.

    If you run it on release mode and with the actual id it should work.

    The odd thing to was that if I let it sit for a bit the dummy adapter message appears every so often (like it is asking for a new ad) and if you wait long enough it might actually show an ad and then you start getting the dummy message again.

    I think it is an Admob server thing and every so often you get a dummy ad.

    Also, try using print on the adSize in the bannerViewWillPresentScreen of the delegate, I was getting height = 0 on there too. When I was using fluid as the size. So the banner was there but you can’t see it because the height is zero.

    Login or Signup to reply.
  2. I use Ionic adMob plugin @capacitor-community/admob
    and constantly was getting this com.google.DummyAdapter for reward video always until I removed isTesting=true, default =false and switch from google testing adId ‘ca-app-pub-3940256099942544/1712485313’ to real one

    RewardAdOptions{
     adId: 'real add id'
     //isTesting: true
    } 
    

    await AdMob.prepareRewardVideoAd(options);

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search