我试图在我的应用程序中实现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