1
請幫我找出爲什麼下面事業NoClassDefFoundError
libGDX應用通過AdMob拋出NoClassDefFoundErrror
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RelativeLayout layout = new RelativeLayout(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
View gameView = initializeForView(new GraphicsView(), false);
// ERROR comes from these lines:
// AdView adView = new AdView(this, AdSize.BANNER, "a14fd65977f0c9f");
// adView.loadAd(new AdRequest());
RelativeLayout.LayoutParams adParams =
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
adParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layout.addView(gameView);
setContentView(layout);
}
你的錯誤在哪裏?無法解析虛擬方法... –
06-12 02:06:39.199:W/dalvikvm(15068):VFY:無法解析虛擬方法6580:Lcom/google/ads/AdView; .setVisibility(I) V 06-12 02:06:39.739:W/dalvikvm(15068):threadid = 1:線程退出時未捕獲的異常(group = 0x40020560) 06-12 02:06:39.749:E/AndroidRuntime(15068)致命例外:main 06-12 02:06:39.749:E/AndroidRuntime(15068):java.lang.NoClassDefFoundError:com.google.ads.AdView 06-12 02:06:39.749:E/AndroidRuntime(15068) :\t at ru.bk.sobaka.nekGameActivity.onCreate(GameActivity.java:112) – Vladimir
完整日誌http://www.fayloobmennik.net/1966850 – Vladimir