0
adMob工作正常,直到我將eclipse更新到最新版本,現在開始時,報告錯誤java.lang.NoClassDefFoundError:com.google.ads.AdRequest。但adMob庫已附加到項目中!謝謝。android adMob找不到類
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator
adRequest.addTestDevice("3xxxxxxxxxx");
AdView adView = new AdView(this, AdSize.BANNER, "axxxxxxxxxx");
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
layout.addView(adView);
adView.loadAd(new AdRequest());
}
,並適當參考和權限上表現
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
pufff就是這樣!出於任何原因未經檢查!感謝您的幫助,謝謝! – Jaume 2012-04-15 19:26:36
很高興得到它的工作。 – lrAndroid 2012-04-15 19:44:49