1

错误是:

02-27 18:41:58.658: E/Ads(30699): An error occurred while destroying an AdWebView:
02-27 18:41:58.658: E/Ads(30699): java.lang.NullPointerException
02-27 18:41:58.658: E/Ads(30699):   at android.webkit.WebView.setWebViewClient(WebView.java:5168)
02-27 18:41:58.658: E/Ads(30699):   at com.google.ads.internal.AdWebView.destroy(SourceFile:252)
02-27 18:41:58.658: E/Ads(30699):   at com.google.ads.internal.c$e.run(SourceFile:191)
02-27 18:41:58.658: E/Ads(30699):   at android.os.Handler.handleCallback(Handler.java:605)
02-27 18:41:58.658: E/Ads(30699):   at android.os.Handler.dispatchMessage(Handler.java:92)
02-27 18:41:58.658: E/Ads(30699):   at android.os.Looper.loop(Looper.java:137)
02-27 18:41:58.658: E/Ads(30699):   at android.app.ActivityThread.main(ActivityThread.java:4511)
02-27 18:41:58.658: E/Ads(30699):   at java.lang.reflect.Method.invokeNative(Native Method)
02-27 18:41:58.658: E/Ads(30699):   at java.lang.reflect.Method.invoke(Method.java:511)
02-27 18:41:58.658: E/Ads(30699):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
02-27 18:41:58.658: E/Ads(30699):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
02-27 18:41:58.658: E/Ads(30699):   at dalvik.system.NativeStart.main(Native Method)
02-27 18:41:58.683: I/Ads(30699): onReceiveAd()

我使用了以下代码:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    <com.google.ads.AdView
        android:id="@+id/ad"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="........."
        ads:loadAdOnCreate="true" />
</LinearLayout>
4

2 回答 2

2

获取使用以下链接的解决方案:

https://developers.google.com/mobile-ads-sdk/download

下载最新的jar文件使用6.3.0 jar就可以解决问题

于 2013-02-27T13:36:42.950 回答
0
An error occurred while destroying an AdWebView:
at android.webkit.WebView.setWebViewClient(WebView.java:5168)

这只是 AdMob SDK 在设置WebViewClient. 这不是你的错。你对此无能为力。使用最新版本的 SDK。

于 2013-02-27T13:32:34.563 回答