0

I have followed an admob tutorial to add an admob banner to my application (this one http://www.wikihow.com/Add-Advertisements-to-Your-Android-Applications-Using-Admob)

I add it using the following code

<com.google.ads.AdView 
    android:id="@+id/adView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    ads:adSize="BANNER" 
    ads:adUnitId="a151ebd8dece188" 
    ads:loadAdOnCreate="true" > 
</com.google.ads.AdView>

I also have in my manifest

<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

</application>

and also

However, whenever I open this view on the app it crashes. I have looked at many admob questions on here but cannot find anything obvious missing from my code. Is it something simple that I am missing?

Kurt
  • 767
  • 8
  • 23

1 Answers1

0

Try some of the following things:

  • Uptade eclipse and android SDK

  • Download adMob SDK from here and add jar in your libs folder. Also don't forget to add jar to your build path

  • Also, don't forget to set permissions (internet, access network state)

  • If nothing works, follow these instructions and it should work!

Let me know if it works

Community
  • 1
  • 1
Guy
  • 6,414
  • 19
  • 66
  • 136
  • Is it necessary to have any reference to the admob in my .java file? I notice in the tutorial you link to it is the same as mine (without any reference) but I have seen some where some simple script is needed in the src aswell. Do you use this? – Kurt Jul 21 '13 at 23:41
  • No, I don't use any reference in java file. Just the part of the code in XML file and it works fine. – Guy Jul 21 '13 at 23:42