Admob测试问题

时间:2014-10-31 20:56:43

标签: android eclipse admob logcat

我的admob实现有问题,希望你们能帮助我。

我似乎无法在日志中找到问题而且我很丢失。我的问题是 - 由于广告无法加载,我做错了什么。该应用程序正常加载,但广告没有显示 - 为什么?这是我的logcat:

10-31 22:05:31.191: D/AbsListView(11349): Get MotionRecognitionManager
10-31 22:05:31.382: D/dalvikvm(11349): DexOpt: --- BEGIN 'ads-16831983.jar' (bootstrap=0) ---
10-31 22:05:31.432: I/Ads(11349): Starting ad request.
10-31 22:05:31.552: D/libEGL(11349): loaded /system/lib/egl/libEGL_adreno200.so
10-31 22:05:31.552: D/libEGL(11349): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
10-31 22:05:31.562: D/libEGL(11349): loaded /system/lib/egl/libGLESv2_adreno200.so
10-31 22:05:31.562: I/Adreno200-EGL(11349): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build: AYELDER_AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.023+PATCH[ES]_msm8960_JB_2.5.5_CL3556704_release_ENGG (CL3556704)
10-31 22:05:31.562: I/Adreno200-EGL(11349): Build Date: 05/17/13 Fri
10-31 22:05:31.562: I/Adreno200-EGL(11349): Local Branch: 
10-31 22:05:31.562: I/Adreno200-EGL(11349): Remote Branch: quic/jb_2.5.5
10-31 22:05:31.562: I/Adreno200-EGL(11349): Local Patches: 34c9e193f12610d3e68dabd6198d2c4bfbc66974 RB: Update the master timestamp of the hw_image in rb_texture_update_aliased
10-31 22:05:31.562: I/Adreno200-EGL(11349): Reconstruct Branch: AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.023 + 01d3c78 + e6f0547 +  LOCAL_PATCH[ES]
10-31 22:05:31.602: D/OpenGLRenderer(11349): Enabling debug mode 0
10-31 22:05:31.742: D/dalvikvm(11349): DexOpt: --- END 'ads-16831983.jar' (success) ---
10-31 22:05:31.742: D/dalvikvm(11349): DEX prep '/data/data/com.example.going_android/cache/ads-16831983.jar': unzip in 0ms, rewrite 362ms
10-31 22:05:32.313: W/Ads(11349): There was a problem getting an ad response. ErrorCode: 1
10-31 22:05:32.323: I/dalvikvm(11349): Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.ads.internal.o.a.evaluateJavascript
10-31 22:05:32.323: W/dalvikvm(11349): VFY: unable to resolve virtual method 3227: Landroid/webkit/WebView;.evaluateJavascript (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
10-31 22:05:32.323: D/dalvikvm(11349): VFY: replacing opcode 0x6f at 0x0016
10-31 22:05:32.363: I/webclipboard(11349): clipservice: android.sec.clipboard.ClipboardExManager@418e1fb0
10-31 22:05:32.393: W/Ads(11349): Failed to load ad: 1
10-31 22:05:32.403: D/WebView(11349): onSizeChanged - w:480 h:75
10-31 22:05:32.443: V/webkit(11349): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {418da9a8}

以下是xml中的相关代码:

<com.google.android.gms.ads.AdView android:id="@+id/adView"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         ads:adSize="BANNER"
                         ads:adUnitId="MY UNIT ID HERE (hidden)"/>

我的.java文件中的相关代码:

AdView adView = (AdView)rootView.findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                .addTestDevice("MY DEVICE ID HERE (hidden)").build();
        adView.loadAd(adRequest);

我希望你们能在这里帮助我!

1 个答案:

答案 0 :(得分:0)

您的代码看起来很好。但是我想知道你部署到哪个版本的Android(或设备)来获取上面的日志。

10-31 22:05:32.313: W/Ads(11349): There was a problem getting an ad response. ErrorCode: 1
10-31 22:05:32.323: I/dalvikvm(11349): Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.ads.internal.o.a.evaluateJavascript
10-31 22:05:32.323: W/dalvikvm(11349): VFY: unable to resolve virtual method 3227: Landroid/webkit/WebView;.evaluateJavascript (Ljava/lang/String;Landroid/webkit/ValueCallback;)V

这些日志行似乎表明Admob正在寻找Android环境中不存在的WebKit方法。

Admob的Google Play版本(您似乎正在使用)仅支持Gingerbread及以上版本。