Forum Xamarin Xamarin.Android

Xamarin.GooglePlayServices.Ads.Lite 71.1720.1 crashes on app start

I just downloaded Xamarin on VS 2019 yesterday and with a quite small app added the Ads stuff.

However, when the app starts up, I get the following.

What should I do?

I saw some similar complaints on Android forums and tried a few things but they didn't work.

ava.Lang.RuntimeException
Message=Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:

The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
should follow the instructions here: https://goo.gl/fQ2neu to add a valid *
App ID inside the AndroidManifest. Google Ad Manager publishers should *
follow instructions here: https://goo.gl/h17b6x. *

Posts

  • alisaadalisaad Member ✭✭

    Same Issue for me ! :(

  • MarcoTronconeMarcoTroncone GBUniversity ✭✭✭

    Hi, If you are trying to use Admob in your apps, I'd suggest you to install the free plugin MarcTron.Admob.
    I've created the plugin and it allows you to add ads in your app in a single line of code.

    You can find a tutorial here: https://www.xamarinexpert.it/admob-made-easy/
    and the nuget package here: https://www.nuget.org/packages/MarcTron.Admob/1.4.4

  • ValentasMatuseviciusValentasMatusevicius LTMember ✭✭
    edited November 2019

    Add these lines to AndroidManifest.xml. Change ca-app-pub**** to your app id from admob
    Between tags

     <application android:label="AppName" android:icon="@drawable/icon" android:usesCleartextTraffic="true">
        <meta-data
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="ca-app-pub-XXXXXXXXXXXX~XXXXXXXX"/>
        <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
      </application>
    
  • Yusuf_AYusuf_A Member ✭✭

    Go to Android option > application tab
    change compile using android vertion to 8.1
    install compatible nuget with 8.1

Sign In or Register to comment.