skip to Main Content

Hello I am getting this error when archiving my app on XCode. The app runs correctly on Simulator and on a Physical Device, but when I try to archive I get this error:

Cannot find type ‘GADInterstitialAd’ in scope

This is pod file:

pod ‘Google-Mobile-Ads-SDK’,’~>8.0′

I import Google ads as well like so:

import GoogleMobileAds

This is interstitial implementation:

GADInterstitialAd.load(withAdUnitID: NSLocalizedString("interstitial_id", comment: ""), request: request, completionHandler: {[weak self] (ad, error) in
        if error != nil {
            return
        }
        self!.interstitial = ad
        self!.interstitial.fullScreenContentDelegate = self
    })

2

Answers


  1. Chosen as BEST ANSWER

    I fixed this issue by moving Pods to trash manually because pod deintegrate didn't work and I reinstalled pods all from scratch. Then I added the Google Ads SDK frameworks to Link Binary With Libraries manually.


  2. You are propably using legacy API for intersticial Ad. Google sometimes changes the API without properly telling everyone..

    Try implementing new Intersticial Ad API where you use GAMInterstitialAd.load instead of GADInterstitialAd.load .

    Here is documentation for new api : Google Intersticial API link

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