我正在使用下面的代码在我的应用程序中实现 admob
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:gravity="bottom"
android:orientation="vertical" >
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.admobdemo"
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
ads:adSize="BANNER"
ads:adUnitId="a24dbba084368tf" />
</LinearLayout>
但是当我运行应用程序时,我收到一条错误消息 adview missing required XML attribute 'adSize' 我无法得到这段代码中的实际问题。
这是我的清单文件代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.admobdemo"
android:versionCode="3"
android:versionName="1.2" >
<uses-sdk android:minSdkVersion="8" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" >
</supports-screens>
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
<activity
android:name=".SplashScreen"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name=".Provider.Permission.WRITE" />
<uses-permission android:name=".Provider.Permission.READ" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>