I'm trying to add AdMob ads to my app but when I do it, as soon as I launch my app it crashes.
This is my XML code:
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="mydevid"
ads:adSize="BANNER"
ads:testDevices="mydeviceid"
ads:loadAdOnCreate="true"/>
Also, once I get it to work, how do I set where exactly is the ad going to be shown? Thank you
Logcat file:
06-13 23:41:03.576: E/AndroidRuntime(17419): FATAL EXCEPTION: main
06-13 23:41:03.576: E/AndroidRuntime(17419): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.matthewstudios.gw2legendary/com.example.gw2legendary.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class com.google.ads.AdView