Just a quick note in case anyone else has had problems with the new Admob 4.1.0 SDK for their Android app. I just updated from 4.0.4, and was having problems.
Adview missing required XML attribute "adSize"
I found this link showing that some changes need to be made from your previously working AdMob setup in your Android app. The changes aren’t shown in the documentation yet.
Changes:
- Remove attrs.xml (or if you need it for your own custom attributes, remove the parts related to AdViews).
- Change the namespace in your layout from xmlns:ads=”http://
schemas.android.com/apk/res/com.your.packagename”
to xmlns:ads=”http://schemas.android.com/apk/lib/com.google.ads“
In addition, by adding this
ads:loadAdOnCreate="true"
You can remove this from your code (which I just added to accommodate the previous Google Admob SDK update). This restores the “just load an ad at startup” functionality that the Admob SDK previously had.
AdView adView = (AdView)this.findViewById(R.id.admob_adview); if(null != adView) { adView.loadAd(new AdRequest()); }
And just like that, I’m using the new AdMob SDK and am getting ads again in my app. I’m glad this release simplified things a little bit.
As a side note, it might be good to hold onto the previous version of third party libraries until you know the new one works. You often can’t get the old one after the new one goes online, and you might just be too tired to figure it out right now. Luckily that wasn’t one of those situations this time.