0

出于某种原因,这条线

adView = new AdView(this, AdSize.BANNER, "xxxxxx");//adUnitId is actually there

每次我尝试运行它时都会使我的 android 应用程序崩溃。

我放入了 GoogleAdMod jar 文件,但没有任何结果

项目属性

target=android-16

AndroidManifest

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

我一直在这家,并尝试过通过xml和类的方法,但我很难过。

提前致谢

-本

编辑:日志

02-02 18:51:14.028: W/IInputConnectionWrapper(11019): getSelectedText on inactive InputConnection
02-02 18:51:14.028: W/IInputConnectionWrapper(11019): setComposingText on inactive InputConnection
02-02 18:51:18.693: I/Choreographer(11019): Skipped 32 frames!  The application may be doing too much work on its main thread.
02-02 18:51:18.763: E/dalvikvm(11019): Could not find class 'com.google.ads.AdView', referenced from method com.ben.fishbein.tictacception.free.Online_home_free.onCreate
02-02 18:51:18.763: W/dalvikvm(11019): VFY: unable to resolve new-instance 457 (Lcom/google/ads/AdView;) in Lcom/ben/fishbein/tictacception/free/Online_home_free;
02-02 18:51:18.763: D/dalvikvm(11019): VFY: replacing opcode 0x22 at 0x0017
02-02 18:51:18.763: I/dalvikvm(11019): DexOpt: unable to optimize static field ref 0x0810 at 0x19 in Lcom/ben/fishbein/tictacception/free/Online_home_free;.onCreate
02-02 18:51:18.773: D/dalvikvm(11019): DexOpt: unable to opt direct call 0x0d0f at 0x1d in Lcom/ben/fishbein/tictacception/free/Online_home_free;.onCreate
02-02 18:51:18.773: D/AndroidRuntime(11019): Shutting down VM
02-02 18:51:18.773: W/dalvikvm(11019): threadid=1: thread exiting with uncaught exception (group=0x411ae438)
02-02 18:51:18.783: E/AndroidRuntime(11019): FATAL EXCEPTION: main
02-02 18:51:18.783: E/AndroidRuntime(11019): java.lang.NoClassDefFoundError: com.google.ads.AdView
02-02 18:51:18.783: E/AndroidRuntime(11019):    at com.ben.fishbein.tictacception.free.Online_home_free.onCreate(Online_home_free.java:82)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.Activity.performCreate(Activity.java:5048)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2113)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.ActivityThread.access$700(ActivityThread.java:139)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1224)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.os.Looper.loop(Looper.java:137)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at android.app.ActivityThread.main(ActivityThread.java:4918)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at java.lang.reflect.Method.invokeNative(Native Method)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at java.lang.reflect.Method.invoke(Method.java:511)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
02-02 18:51:18.783: E/AndroidRuntime(11019):    at dalvik.system.NativeStart.main(Native Method)



public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.free_online_home);
    bigBoard = (RelativeLayout) findViewById(R.id.rlBigBoard);

    adView = new AdView(this,  AdSize.BANNER, "aasd0");
            //new AdView(this, AdSize.BANNER, "asdsd");
//  bigBoard.addView(adView);
    //adView.loadAd(new AdRequest());

    // AdView ad = (AdView) findViewById(R.id.adView);
    //ad.loadAd(new AdRequest());
    //initialize();
}
4

1 回答 1

1

如果 GoogleAdMobAdsSdk 在您的引用库中,我的文件顺序错误 请确保它位于您的 src 或 res 文件夹之前的顶部。

于 2013-02-03T02:09:58.603 回答