点击测试广告(横幅或插页式广告)会崩溃Android应用

时间:2014-08-25 11:56:12

标签: android admob

我在我的应用程序中(在不同的地方)添加了Admob横幅广告和插页式广告。要测试广告是否正常工作,我在制作广告请求时添加了测试deviceId,如下所示,

        AdRequest adRequest = new AdRequest.Builder().addTestDevice("*********...").build();
        adView.loadAd(adRequest);

测试广告按预期发布,但是当我点击测试广告时,它会崩溃应用程序。这是正常的吗?

错误日志虽然在类似的行中,但随着测试广告的变化略有变化(活动名称),如下所示,

        android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mobeam.barcodeService/com.google.android.gms.ads.AdActivity}; have you declared this activity in your AndroidManifest.xml?
        08-25 17:10:58.276: W/System.err(27595):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1648)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1442)
        at android.app.Activity.startActivityForResult(Activity.java:3511)
        at android.app.Activity.startActivityForResult(Activity.java:3472)
        at android.app.Activity.startActivity(Activity.java:3714)
        at android.app.Activity.startActivity(Activity.java:3682)
        at agl.startActivity(SourceFile:71)
        at acl.a(SourceFile:120)
        at agm.a(SourceFile:233)
        at agm.a(SourceFile:165)
        at abl.a(SourceFile:102)
        at agm.a(SourceFile:377)
        at agm.shouldOverrideUrlLoading(SourceFile:293)
        at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:293)
        at com.android.org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:96)
        at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
        at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:157)
        at android.app.ActivityThread.main(ActivityThread.java:5356)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
        at dalvik.system.NativeStart.main(Native Method)

我正在使用新的Admob,应用程序使用调试密钥进行签名。我可以假设在发布模式下它会按预期工作吗?如果不是那么如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

确保您已在AndroidManfiest.xml

中声明了这一点
<activity
    android:name="com.google.android.gms.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

然后你应该可以点击广告,它不应该崩溃。