У меня проблема с интеграцией рекламного сервиса Google Play с моей компоновкой. Я сделал все, что видел в Интернете, для меня ничего не работало.Ошибка в сервисе Google Play (объявления)
Примечание: «XXX» или «X» предназначены только для скрытия некоторой информации.
Это мой макет:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height=
"wrap_content" android:gravity="center">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ff000000"
android:gravity="center_horizontal" >
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-XXXXXXX" />
</RelativeLayout>
<ListView android:id="@+id/timetable" android:choiceMode="none"
android:layout_width="230px" android:layout_height="205px"
android:padding="5dip" />
<TextView style="@style/finePrint" android:id="@+id/notes"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
и я, что делать в манифесте:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="XXX"
android:versionCode="X"
android:versionName="x" >
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="4" />
<supports-screens />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Include required permissions for Google Mobile Ads to run -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:description="@string/description"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/DialogTheme" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".XXX"
android:configChanges="keyboardHidden|orientation|locale"
android:label="@string/app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".receiver.StartNotificationReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.ClickNotificationReceiver" />
<receiver android:name=".receiver.ClearNotificationReceiver" />
<service android:name=".service.FillDailyTimetableService" />
<service android:name=".service.StartNotificationService" />
<receiver
android:name=".widget.TimetableWidgetProvider"
android:label="@string/adhan_timetable" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_timetable" />
</receiver>
<receiver
android:name=".widget.NextNotificationWidgetProvider"
android:label="@string/XXX" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_next_notification" />
<!-- Include the AdActivity configChanges and theme. -->
</receiver>
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
</application>
</manifest>
, но когда я пытаюсь обед приложение, оно не «К сожалению, XXX имеет остановлено "
Что я сделал не так?
Я видел его, и сделал то же самое, что делает не работает, возможно, его макет, много пробовал, но не работал –
, пожалуйста, помогите !!! –
Вы проверили другие необходимые вещи, которые нужно добавить, например, настроить Gradle, добавив логику в класс java, указав идентификатор рекламного блока .. проверьте этот список https://developers.google.com/admob/android/quick-start – AniV