Добрый день!
Пытаюсь добавить рекламу в свое приложение, все по инструкции https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start.
Сначала добавил строчку в build.gradle (module: app)
compile 'com.google.android.gms:play-services:7.0.0'
Изменил манифест
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
+
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
Добавил
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
Изменил .xml файл
xmlns:ads="http://schemas.android.com/apk/res-auto"
+
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
Добавил в код активити:
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
+
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
При рендеринге в android studio видно место под баннер, но при запуске приложения баннера нет
05-05 15:14:49.746 1386-1386/su.worldbest.bbdd W/GooglePlayServicesUtil﹕ Google Play services is missing.
05-05 15:14:49.770 1386-1386/su.worldbest.bbdd W/GooglePlayServicesUtil﹕ Google Play services is missing.
05-05 15:14:49.790 1386-1389/su.worldbest.bbdd D/dalvikvm﹕ GC_CONCURRENT freed 208K, 3% free 8742K/8976K, paused 4ms+2ms, total 14ms
05-05 15:14:49.802 1386-1386/su.worldbest.bbdd I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
05-05 15:14:49.814 1386-1386/su.worldbest.bbdd I/Ads﹕ Starting ad request.
05-05 15:14:49.818 1386-1386/su.worldbest.bbdd I/Ads﹕ Use AdRequest.Builder.addTestDevice("D5C4A6CB58FB68100CD3CBDF39CB8F22") to get test ads on this device.
05-05 15:14:49.870 1386-1398/su.worldbest.bbdd D/dalvikvm﹕ DexOpt: --- BEGIN 'ads-1062427778.jar' (bootstrap=0) ---
05-05 15:14:49.894 1386-1398/su.worldbest.bbdd D/dalvikvm﹕ DexOpt: --- END 'ads-1062427778.jar' (success) ---
05-05 15:14:49.894 1386-1398/su.worldbest.bbdd D/dalvikvm﹕ DEX prep '/data/data/su.worldbest.bbdd/cache/ads-1062427778.jar': unzip in 0ms, rewrite 22ms
05-05 15:14:50.330 1386-1405/su.worldbest.bbdd I/Ads﹕ CsiReporterFactory: CSI is not enabled. No CSI reporter created.
Баннера не видно ни на эмуляторе, ни на реальном устройстве. Что делать?
Google Play services is missing.