Android IDE (AIDE) Support Forum

App crash after adding admob

My app crash anytime i add this dependency com.google.android.gms:play-services-ads:+

Did you also add the required codes in AndroidManifest.xml?

Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713
meta-data
android:name=“com.google.android.gms.ads.APPLICATION_ID”
android:value=“YOUR_ADMOB_APP_ID”

Visit the site link below to see the actual codes mentioned above.
ref: https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk

I use official google sample project that i downloaded from https://github.com/googlesamples/android-ads/tree/master/admob/BannerExample
The required codes already included but the app crash after it successfully compiled!
Below is the screen shot
Screenshot_2019-05-31-14-44-52|281x500

This is AppCompat crash
You can use older version of admob to fix

Please can you give me a link to download the older version of admob that can work?

Downloading is not required just replace version in gradle

I changed my dependencies to the following

dependencies {
implementation ‘com.android.support:appcompat-v7:26.1.0’
implementation ‘com.google.android.gms:play-services-ads:+’
}
But still the app crash

Implementation (‘android.arch.core:runtime:+’) {
force = true
}
Add this to depencies and refresh build

This has even make it worse, I get a lot of errors afterwards. Please do you have any sample project?

Hello @Shamsuddeen

Did you find any solution?
I am encountering the sane problem, I modified the gradle.build file and now the Ad works using Admob test ID but nothing appears when I use my own AdMob ID. The good news is that the app does not crash…
Try this:
compile 'com.google.android.gms:play-services-ads:11.0.4’

Yes i found the solution. I hope you too you have the solution

Your project will work with this version.

implementation ‘com.google.android.gms:play-services-ads:11.6.0’

11.8.0 seems to be working for me too, but anything higher than that doesn’t…