Reputation: 10199
I understand the issue that there isn't enough space to show the ad but I don't know how to fix it. I am guessing that something is using up too much space but I'm not sure exactly what it is. I am specifically referring to the admob ad not amazon ad.
This is the logcat:
08-13 19:09:42.972: ERROR/Ads(891): Not enough space to show ad! Wants: <480, 75>, Has: <432, 610>
08-13 19:09:42.972: ERROR/Ads(891): Not enough space to show ad! Wants: <480, 75>, Has: <432, 97>
This is my xml file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:Amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads"
android:layout_height="match_parent"
android:background="@drawable/background5"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:id="@+id/MainLayout"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
tools:context=".MainActivity">
//start button
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Start"
android:background="#19d2b2"
android:id="@+id/start_button"
android:layout_above="@+id/instructions_button5"
android:layout_centerHorizontal="true"/>
//Instructions button
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Instructions"
android:background="#19d2b2"
android:id="@+id/instructions_button6"
android:layout_below="@+id/start_button"
android:layout_alignLeft="@+id/start_button"
android:layout_marginTop="10dp"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Gallery"
android:background="#19d2b2"
android:id="@+id/save_button"
android:layout_below="@+id/instructions_button6"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Scores"
android:id="@+id/Scores"
android:background="#19d2b2"
android:layout_below="@+id/save_button"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"/>
<com.amazon.device.ads.AdLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Amazon:adSize="320x75"
android:layout_marginTop="400dp"/>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="400dp"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxxxxxxxxxxxx"
ads:adSize="BANNER"
android:layout_marginTop="300dp" android:layout_marginBottom="10dp"/>
Upvotes: 0
Views: 581
Reputation: 35539
just remove
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
from relative layout and your problem is solved
Upvotes: 0
Reputation: 20196
You have configured the enclosing RelativeLayout with
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
this will reduce the amount of horizontal space available to your AdView. Remove these and it should work.
Upvotes: 1