我試圖在我的應用程序中實現AdMob。但不知道它顯示這個錯誤,我的R.java文件並沒有被生成,因爲它。我嘗試了所有方法來解決這個問題,比如Clean,Build,Build All。但非是爲我工作。 繼我的代碼片段中,其示值誤差「錯誤在解析XML:未綁定前綴」AdMob在android「AdView缺少必需的XML屬性'adSize'」
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:background="@color/bgcolor">
<LinearLayout
android:id="@+id/Linearlayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="XXX"
ads:refreshInterval="60"/>
</LinearLayout>
請幫助我。我在這裏停留:(
我嘗試添加上述行,但後來也是其無法正常工作。對於上面的工作,我是否還必須在'res'目錄中創建'lib'文件夾並將AdMob jar複製到它? – YuDroid
後來當我再次重建並清理該項目時,上面的解決方案爲我工作。感謝Eren – YuDroid
還有一件事要做,就是當我在使用'libs'文件夾嘗試上述代碼時,廣告沒有得到顯示。但是當我將它改爲'lib'時,它的工作沒有麻煩。 – YuDroid