Admob Banner Crush My App

时间:2015-02-19 06:32:54

标签: android admob

爪哇:

AdView mAdView = (AdView)findViewById(R.id.adView);
AdRequest adRequest1 = new AdRequest.Builder().build();
mAdView.loadAd(adRequest1);

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="ca-app-pub-3120115167679545/1048517917" >

    </com.google.android.gms.ads.AdView>

Lgcat:

02-19 11:01:57.460: I/dalvikvm(338): Could not find method android.view.ViewGroup.onInitializeAccessibilityNodeInfo, referenced from method android.support.v7.widget.LinearLayoutCompat.onInitializeAccessibilityNodeInfo
02-19 11:01:57.460: W/dalvikvm(338): VFY: unable to resolve virtual method 11742: Landroid/view/ViewGroup;.onInitializeAccessibilityNodeInfo (Landroid/view/accessibility/AccessibilityNodeInfo;)V
02-19 11:01:57.470: D/dalvikvm(338): VFY: replacing opcode 0x6f at 0x0006
02-19 11:01:57.470: D/dalvikvm(338): VFY: dead code 0x0009-0011 in Landroid/support/v7/widget/LinearLayoutCompat;.onInitializeAccessibilityNodeInfo (Landroid/view/accessibility/AccessibilityNodeInfo;)V
02-19 11:01:57.492: W/KeyCharacterMap(338): No keyboard for id -1
02-19 11:01:57.492: W/KeyCharacterMap(338): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-19 11:02:05.410: W/Ads(338): Could not parse XML attribute "adSize": Banner
02-19 11:02:05.660: D/AndroidRuntime(338): Shutting down VM
02-19 11:02:05.660: W/dalvikvm(338): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-19 11:02:05.700: E/AndroidRuntime(338): FATAL EXCEPTION: main
02-19 11:02:05.700: E/AndroidRuntime(338): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.neq3.shahg.vigetablecrush/com.neq3.shahg.vigetablecrush.HomeActivity}: java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.os.Looper.loop(Looper.java:123)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread.main(ActivityThread.java:3683)
02-19 11:02:05.700: E/AndroidRuntime(338):  at java.lang.reflect.Method.invokeNative(Native Method)
02-19 11:02:05.700: E/AndroidRuntime(338):  at java.lang.reflect.Method.invoke(Method.java:507)
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-19 11:02:05.700: E/AndroidRuntime(338):  at dalvik.system.NativeStart.main(Native Method)
02-19 11:02:05.700: E/AndroidRuntime(338): Caused by: java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.google.android.gms.internal.bh.bn(Unknown Source)
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.google.android.gms.internal.bh.a(Unknown Source)
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
02-19 11:02:05.700: E/AndroidRuntime(338):  at com.neq3.shahg.vigetablecrush.HomeActivity.onCreate(HomeActivity.java:30)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-19 11:02:05.700: E/AndroidRuntime(338):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-19 11:02:05.700: E/AndroidRuntime(338):  ... 11 more

0 个答案:

没有答案