Adwhirl 与 Admob java.lang.NosuchMethodError:com.google.ads.AdView.destroy
我正在将 adwhirl 与 admob 一起使用。广告出现了,但我在日志中收到此异常 java.lang.NosuchMethodError:com.google.ads.AdView.destroy 我不明白为什么.. 我在我的活动中使用 adwhirl 布局来请求广告..
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();
并且我只是使用其他 AdNw 的 SDK,在清单中声明它们 这是请求广告的正确方式吗???
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 ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AdMob Adapter 在销毁时会调用 destroy 方法。如果您的应用程序中包含 AdMob SDK,则应该存在该方法。确保您拥有最新版本 (4.3.1) 的 Google AdMob SDK 并且您已将其包含在您的应用程序中。
另外,这就是您在清单中声明 AdMob 的 AdActivity 的方式吗?
最后,我不知道它是否与此问题有关,但您定义了一些
RelativeLayout
参数,但将其添加到LinearLayout
中。您实际上根本不需要指定这些参数。这应该足够了: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?
Finally, I don't know if it is related to this issue, but you defined some
RelativeLayout
params but you are adding it to aLinearLayout
. You don't really need to specify those params at all. This should suffice: