2013-02-03 61 views
0

出于某种原因,这条线横幅广告崩溃的Android AP

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

崩溃我的Android应用程序曾经一次,我尝试运行它。

我放在GoogleAdMod jar文件,但还没有进行这

project.properties

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和类的方法,但我很难过。

在此先感谢

-Ben

编辑:原木

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(); 
} 
+0

显示包含异常的日志文件。 – ezcoding

+0

好的我添加了日志 –

+0

好像你还没有正确添加Jar文件。看看这个链接,并按照步骤http://stackoverflow.com/questions/6327434/how-to-add-the-jar-file-into-the-build-path – ezcoding

回答

1

我有我的文件,以错误的顺序,如果GoogleAdMobAdsSdk是你引用的库确保它在顶部在你的src或res文件夹之前。