Note that there are some explanatory texts on larger screens.

plurals
  1. POAdmob: Could not initialize AdView: Required XML attribute "adSize" missing
    text
    copied!<p>I follow the steps in the official link, and I can't find where is the problem. I have downloaded the libs from: <a href="https://developers.google.com/mobile-ads-sdk/download#downloadandroid" rel="nofollow">https://developers.google.com/mobile-ads-sdk/download#downloadandroid</a> This is my code: In MainActivity i add:</p> <pre><code>adView = (AdView) findViewById(R.id.ad); AdRequest adRequest = new AdRequest(); adView.loadAd(adRequest); </code></pre> <p>In Manifest:</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /&gt; </code></pre> <p>And the xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/lytMain" xmlns:tools="http://schemas.android.com/tools" xmlns:ads="http://schemas.android.com/apk/libs/com.google.ads" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;com.google.ads.AdView android:id="@+id/ad" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="ca-app-pub-xxxxxxxx/xxxxxx" ads:testDevices="TEST_EMULATOR" ads:loadAdOnCreate="true" &gt; &lt;/com.google.ads.AdView&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2" android:gravity="center" &gt; &lt;TextView android:id="@+id/cargando" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Cargando resultados..." android:textColor="@android:color/black" android:textSize="20sp" /&gt; &lt;ProgressBar android:id="@+id/progress" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@android:style/Widget.ProgressBar.Small.Inverse" android:layout_marginRight="5dp" /&gt; &lt;Button android:id="@+id/button" android:visibility="invisible" android:layout_marginTop="10dp" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Ver resultados" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload