0

i'm using adwhirl with admob..The ads appears but i'm getting this exception in the log java.lang.NosuchMethodError:com.google.ads.AdView.destroy i don't understand why .. i'm using adwhirl layout in my activites to request the ads..

LinearLayout adLayout = (LinearLayout) findViewById(R.id.ads);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "---------");
RelativeLayout.LayoutParams adWhirlLayoutParams = new 
    RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
                                LayoutParams.WRAP_CONTENT);
adLayout.addView(adWhirlLayout, adWhirlLayoutParams);
adLayout.invalidate();

and i'm just using the SDKs for the other AdNw ,declaring them in the manifest is it the right way to request Ads ???

Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28
Reham
  • 1,916
  • 6
  • 21
  • 45

1 Answers1

1

The AdMob Adapter will call the destroy method when it is being destroyed. That method should be exist if you have the AdMob SDK included in your app. Make sure that you have the most recent version (4.3.1) of the Google AdMob SDK and that you have included it in your app.

Also, is this how you declared the AdActivity for AdMob in the manifest?

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

Finally, I don't know if it is related to this issue, but you defined some RelativeLayout params but you are adding it to a LinearLayout. You don't really need to specify those params at all. This should suffice:

LinearLayout adLayout = (LinearLayout) findViewById(R.id.ads);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "YOUR_ADWHIRL_KEY_GOES_HERE");
adLayout.addView(adWhirlLayout);
Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28
  • Thanks alot..i used 4.3.1 now but this error : The android:configChanges value of the com.google.ads.Ads.AdActivity must include screenSize. The android:configChanges value of the com.google.adsAdActivity must include SmallestscreenSize. What shall i do?? – Reham Dec 08 '11 at 08:00
  • Check out this blog post (http://googleadsdeveloper.blogspot.com/2011/11/migrating-to-v431-of-admob-sdk-for.html) for how to move to using version 4.3.1. – Eric Leichtenschlag Dec 08 '11 at 17:48
  • Thanks alot Eric..now admob works for me ..:) but i want to use other adnetwork wih adwhirl and admob but i don't know if i must do it the same way.. – Reham Dec 09 '11 at 17:27
  • Adding AdMob caused you a bit of trouble because the manifest definition changed in the most recent SDK. Other ad networks should be pretty easy to include. Just add their library files, add the manifest activity definitions that they require, and get an id from their site and configure it in the AdWhirl UI. Is there any other network in particular you are having trouble adding? – Eric Leichtenschlag Dec 09 '11 at 20:16
  • i used zest,Millineal Media and Mdotm zest is ok but Millineal Media keeps showing Large Ads,and mdotm slow down my application, anyway i just put thier SDks ,declaring them in the manifest as you said and i used the same code above but i wanna ask you something when i used admob i had to put target=android-13 and in the manifest i put the min Sdk =8 can i gurantee that it will work on all android Devices (2.2 and above) – Reham Dec 10 '11 at 17:25
  • That's correct. The latest AdMob SDK requires you put target=android-13 or above to "compile" against a newer version of android. But using minSdk=8 allows your app to run on 2.2 devices and higher with no problem. Just make sure you tested your app on a 2.2 emulator or device to make sure you didn't use any Android APIs higher than level 8. I'm not sure why Millennial is showing large ads. Are they not ~320x50 like AdMob? – Eric Leichtenschlag Dec 12 '11 at 17:43
  • yeh i tested it and it works fine..thanks.. no its much bigger than admob ads,but i think there is an attribute that i must change to enable it to show small ads,but the problem i don't know where to put this attr..because as i told you before i'm just putting the above code in my application to request these ads ... – Reham Dec 13 '11 at 19:58
  • Hi Again...i just want to know if this problem is server side...or i must fix something in my code... onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.) – Reham Jan 08 '12 at 15:23