Error when trying to display ads - Android C# Xamarin

Viewed 99

I am trying to display AdMob ads in my App, but I am getting an error. I have added Google Play Services, and all my code checks out, I am also using AdMob's own test Ad Id and all the code is from the AdMod guide. Is there anything I could have missed?

Main Activity Ad Code:

 protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //AdMob
            mAdView = (AdView)FindViewById<AdView>(Resource.Id.adView);
            AdRequest adRequest = new AdRequest.Builder().Build();
            mAdView.LoadAd(adRequest);
            //AdMob

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            ActionBar.Hide();

Main.axml AdView Code:

 <com.google.android.gms.ads.AdView
          xmlns:ads="http://schemas.android.com/apk/res-auto"
          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="HERE_MY_UNIT_ID">
  </com.google.android.gms.ads.AdView>

Error Message:

enter image description here

1 Answers
Related