K
K
Kirill Petrov2015-05-26 22:21:57
Java
Kirill Petrov, 2015-05-26 22:21:57

Why does an error occur and admob won't load?

I can't add ads.
Here updated all the components and created a new project. Did according to the instructions . As a result I get:

05-26 21:54:19.159    8124-8124/com.pervayaavto.mobile E/PhonePolicy﹕ Could not preload class for phone policy: com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
05-26 21:54:20.399    8124-8124/com.pervayaavto.mobile E/dalvikvm﹕ Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
05-26 21:54:22.059    8124-8124/com.pervayaavto.mobile E/dalvikvm﹕ Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.ij.a
05-26 21:54:22.079    8124-8124/com.pervayaavto.mobile E/dalvikvm﹕ Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.google.android.gms.common.ij.b

Ads are not shown.
I load ads like this:
// Создание экземпляра adView.
        adView = new AdView(this);
        adView.setAdUnitId("ca-app-pub-7684432941227028/6051161799");
        adView.setAdSize(AdSize.BANNER);

        // Поиск разметки LinearLayout (предполагается, что ей был присвоен
        // атрибут android:id="@+id/mainLayout").
        RelativeLayout layout = (RelativeLayout)findViewById(R.id.mainLayout);

        // Добавление в разметку экземпляра adView.
        layout.addView(adView);

        // Инициирование общего запроса.
        AdRequest adRequest = new AdRequest.Builder().addTestDevice("93A9F945BDD6BC90ABAD72F4BC7D7FC3").build();

        // Загрузка adView с объявлением.
        adView.loadAd(adRequest);

The first example on the list from this page also gives this error.
Sources put here: https://yadi.sk/d/p7rKMyylgtNxD

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question