我尝试实施Adwhril并添加了Millenial Media,ZestAdz和InMobi网络。我还设置了自家广告进行备份。
现在的问题是,当Adwhril试图显示来自InMobi的广告时,会出现一个大的空白黑屏,应用程序挂起,之后没有任何事情发生。一切都被卡住了。它甚至没有发出任何警告或错误。
只有展示的广告才是我的HouseAd(自定义广告)。除了HouseAd之外,其他任何广告都没有显示:(
当它试图展示来自Millenial Ads的广告时,我会收到以下错误:
09-06 21:37:04.227: D/AdWhirl SDK(281): Valid adapter, calling handle()
09-06 21:37:04.234: W/AdWhirl SDK(281): Caught an exception in adapter:
09-06 21:37:04.234: W/AdWhirl SDK(281): java.lang.NoSuchMethodError: com.millennialmedia.android.MMAdView.<init>
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.adwhirl.adapters.MillennialAdapter.handle(MillennialAdapter.java:77)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.adwhirl.adapters.AdWhirlAdapter.handle(AdWhirlAdapter.java:168)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:231)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.adwhirl.AdWhirlLayout.access$300(AdWhirlLayout.java:53)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:399)
09-06 21:37:04.234: W/AdWhirl SDK(281): at android.os.Handler.handleCallback(Handler.java:587)
09-06 21:37:04.234: W/AdWhirl SDK(281): at android.os.Handler.dispatchMessage(Handler.java:92)
09-06 21:37:04.234: W/AdWhirl SDK(281): at android.os.Looper.loop(Looper.java:123)
09-06 21:37:04.234: W/AdWhirl SDK(281): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-06 21:37:04.234: W/AdWhirl SDK(281): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 21:37:04.234: W/AdWhirl SDK(281): at java.lang.reflect.Method.invoke(Method.java:521)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-06 21:37:04.234: W/AdWhirl SDK(281): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-06 21:37:04.234: W/AdWhirl SDK(281): at dalvik.system.NativeStart.main(Native Method)
09-06 21:37:04.234: D/AdWhirl SDK(281): Showing ad:
09-06 21:37:04.234: D/AdWhirl SDK(281): nid: xxxxxxxxxxxxxxxxxxxxxxxxxxx
09-06 21:37:04.234: D/AdWhirl SDK(281): name: custom
09-06 21:37:04.234: D/AdWhirl SDK(281): type: 9
09-06 21:37:04.234: D/AdWhirl SDK(281): key: __CUSTOM__
09-06 21:37:04.234: D/AdWhirl SDK(281): key2:
09-06 21:37:04.234: D/AdWhirl SDK(281): Generic adapter will get destroyed
当它试图显示ZestAdz而不是我收到以下消息时
09-06 22:02:44.063: D/AdWhirl SDK(328): Showing ad:
09-06 22:02:44.063: D/AdWhirl SDK(328): nid: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
09-06 22:02:44.063: D/AdWhirl SDK(328): name: zestadz
09-06 22:02:44.063: D/AdWhirl SDK(328): type: 20
09-06 22:02:44.063: D/AdWhirl SDK(328): key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
09-06 22:02:44.063: D/AdWhirl SDK(328): key2:
09-06 22:02:44.063: W/AdWhirl SDK(328): Unsupported ration type: 20
09-06 22:02:44.122: D/dalvikvm(328): GC_FOR_MALLOC freed 2068 objects / 351008 bytes in 53ms
09-06 22:02:44.132: W/AdWhirl SDK(328): Caught an exception in adapter:
09-06 22:02:44.132: W/AdWhirl SDK(328): java.lang.Exception: Invalid adapter
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.adwhirl.adapters.AdWhirlAdapter.handle(AdWhirlAdapter.java:170)
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:231)
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.adwhirl.AdWhirlLayout.access$300(AdWhirlLayout.java:53)
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.adwhirl.AdWhirlLayout$HandleAdRunnable.run(AdWhirlLayout.java:399)
09-06 22:02:44.132: W/AdWhirl SDK(328): at android.os.Handler.handleCallback(Handler.java:587)
09-06 22:02:44.132: W/AdWhirl SDK(328): at android.os.Handler.dispatchMessage(Handler.java:92)
09-06 22:02:44.132: W/AdWhirl SDK(328): at android.os.Looper.loop(Looper.java:123)
09-06 22:02:44.132: W/AdWhirl SDK(328): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-06 22:02:44.132: W/AdWhirl SDK(328): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 22:02:44.132: W/AdWhirl SDK(328): at java.lang.reflect.Method.invoke(Method.java:521)
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-06 22:02:44.132: W/AdWhirl SDK(328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-06 22:02:44.132: W/AdWhirl SDK(328): at dalvik.system.NativeStart.main(Native Method)
任何人都可以请指出我做错了什么,并指导我如何解决这个问题?
谢谢!!
答案 0 :(得分:0)
确保您已包含最新版本的适配器和SD卡。 还要检查您是否已在adwhirl站点中添加了要集成的网络的网络ID。
以下是使用相同代码的示例代码。 在xml文件中添加
<com.adwhirl.AdWhirlLayout
android:id="@+id/adwhirl_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
代码更改:
AdWhirlLayout adWhirlLayout2 = new AdWhirlLayout(this,"46a9e26bb1f5499ab7b00c9807ae034b");
adWhirlLayout2.setAdWhirlInterface(this);
adWhirlLayout2.setMaxWidth(width);
adWhirlLayout2.setMaxHeight(height);
AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5);
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
adWhirlLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
layout.setGravity(Gravity.CENTER_HORIZONTAL);
layout.addView(adWhirlLayout2, adWhirlLayoutParams);
不要忘记权限。
请发布您的代码。它将更容易调试。 如有任何疑问,请联系helpdesk@inmobi.com