Reputation: 1425
Hello I am new to using the admob ads and I am having a weird issue. I added the testing ads using the following link: http://www.androidhive.info/2016/02/android-how-to-integrate-google-admob-in-your-app/
The ads worked great last night. I opened my application tonight and for some reason the ads tab was gone, looking at the console I am getting the following error: I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
Any ideas what could be happening? Thank you!
JAVA:
MobileAds.initialize(getApplicationContext(), "ca-app-pub-3940256099942544~3347511713");
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("ID from device added removed for post")
.build();
mAdView.loadAd(adRequest);
GRADLE:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'com.google.firebase:firebase-ads:9.0.2'
}
XML:
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
Upvotes: 0
Views: 2096
Reputation: 4705
Please check The following process, It may be help you
First Check Project level gradel, Do you have implemented class path like following, classpath 'com.google.gms:google-services:3.0.0'
After then check app level dependency like following compile 'com.google.firebase:firebase-ads:9.0.2'
(as per latest library)
After then apply plugin at bottom like following apply plugin: 'com.google.gms.google-services'
And then after check your App Id or Unit Id is correct which you set.
Then check your layout where you declare your add, Does following namespace implemented or not xmlns:ads="http://schemas.android.com/apk/res-auto"
And If you are using InterstitialAd then it require to add testing device Id like following way,
AdRequest adRequest = new AdRequest.Builder() .addTestDevice("SEE_YOUR_LOGCAT_TO_GET_YOUR_DEVICE_ID") .build();
This all Thing may be help you,
Upvotes: 1