Admob ads not showing on android emulater -
i have added admob codes showing ads in app. when run app in emulator opens splash screen , app exits saying "unfortunately,your app has stopped". don't know why showing. works before addding admob codes.i have added code. me this.
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"`` android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background2" > <scrollview android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerinparent="true" android:scrollbars="none"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:orientation="vertical" > <imagebutton android:id="@+id/imagebutton1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_margintop="60dp" android:background="@null" android:padding="30dp" android:src="@drawable/menu1" android:contentdescription="@string/image_desc" /> <imagebutton android:id="@+id/imagebutton2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/imagebutton1" android:background="@null" android:padding="30dp" android:src="@drawable/menu2" android:contentdescription="@string/image_desc" /> <imagebutton android:id="@+id/imagebutton3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/imagebutton2" android:background="@null" android:padding="30dp" android:src="@drawable/menu3" android:contentdescription="@string/image_desc" /> <imagebutton android:id="@+id/imagebutton4" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/imagebutton3" android:background="@null" android:padding="30dp" android:src="@drawable/menu4" android:contentdescription="@string/image_desc" /> <imagebutton android:id="@+id/imagebutton5" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_below="@+id/imagebutton4" android:background="@null" android:padding="30dp" android:src="@drawable/menu5" android:contentdescription="@string/image_desc" /> </linearlayout> </scrollview> <com.google.ads.adview android:id="@+id/adview" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adunitid="admob id" ads:adsize="smart_banner" ads:loadadoncreate="true"/> </relativelayout>
there might problem adding googleadmobsdk cross check link visit https://developers.google.com/mobile-ads-sdk/docs/#android.
Comments
Post a Comment