正如標題所述,即使我很確信自己已獲得Android Manifest中的正確代碼,我仍然遇到了該特定錯誤。我已經檢查了常見的錯誤,如偶然輸入「用戶」而不是「用」,並確保我使用單數「許可」。儘管我盡了最大的努力,但我仍然遇到這個錯誤。我希望你們其中一位能指出我失蹤的事情。錯誤:「您必須擁有INTERNET和ACCESS_NETWORK_STATE權限」與AdMob
下面是Android清單
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
</activity>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
相關部分及這裏的數字應顯示測試廣告我佈局的整體。相關視圖位於最底部附近。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".HomeActivity" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight=".5"
tools:context=".HomeActivity">
<!-- Space reserved for buttons at top of screen -->
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight="1"
tools:context=".HomeActivity">
<Button
android:id="@+id/btnAddRevenue"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_alignParentLeft="true"
android:text="@string/btnAddRevenue_Text" />
<Button
android:id="@+id/btnAddExpense"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_alignParentRight="true"
android:text="@string/btnAddExpense_Text" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight="5"
tools:context=".HomeActivity">
<ListView
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
<!-- <TextView
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:text="@string/fillerText" /> -->
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight=".5"
tools:context=".HomeActivity">
<!-- Space reserved for ads -->
<com.google.ads.AdView
android:id="@+id/adHome_bottomBanner"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
ads:adUnitId="@string/adId_bottomBanner"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
ads:loadAdOnCreate="true" />
</LinearLayout>
你在哪裏添加admob id? – Shrikant