I had added google AdMob to the project and found this error : error: cannot find symbol import com.google.android.gms.ads.InterstitialAd; ^ symbol: class InterstitialAd location: package com.google.android.gms.ads
I found the answer : add this codes to build.gradle(app) (in the android tag )
configurations.all {
resolutionStrategy {
force "com.google.android.gms:play-services-basement:17.0.0"
force "com.google.android.gms:play-services-base:17.1.0"
force "com.google.android.gms:play-services-stats:17.0.0"
force "com.google.android.gms:play-services-gcm:17.0.0"
force "com.google.android.gms:play-services-ads:22.6.0"
}
}
and if you had use of admob in the one library add codes above to library gradle too