Search code examples
androidandroid-studiointerstitial

Fix android studio Firebase Ads Library showing errors after update


After updating the following firebase ads libraries

implementation 'com.google.android.gms:play-services-ads:20.1.0'
implementation 'com.google.firebase:firebase-ads:20.1.0'

My android studio project keeps throwing errors such as this

 cannot find symbol
 import com.google.android.gms.ads.InterstitialAd;

 Cannot resolve symbol 'InterstitialAd'

It is fine if i revert back to

implementation 'com.google.android.gms:play-services-ads:19.3.0'
implementation 'com.google.firebase:firebase-ads:19.4.0'

But to implement some function and native ad in my app, I need the latest firebase Ads Library. How can I fix this?


Solution

  • in version-20 the classes are changed. Use this;

    com.google.android.gms.ads.interstitial.InterstitialAd;

    See more details here