Ads are not displayed, error 403

Admob does not display ads for my application. Ad impressions appear, but no real ads.

This error should be displayed if my account is disabled. But I can log in to my admob account.

I also tested it on other phones with different accounts and with different connectivity, but still useless.

here is log

W/Ads: Received error HTTP response code: 403
 /myapp.test W/Ads: There was a problem getting an ad response. ErrorCode: 0
 /myapp.test W/Ads: Failed to load ad: 0

--- Later added ---

Here is the layout file

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="15dp"
    android:layout_marginRight="15dp"
    android:orientation="vertical"
    app:behavior_overlapTop="64dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    app:theme="@style/AppTheme"
    tools:showIn="@layout/activity_main">

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <android.support.v7.widget.CardView
                android:id="@+id/baseView"
                android:layout_width="match_parent"
                android:layout_height="280dp"
                android:padding="10dp">

            </android.support.v7.widget.CardView>
            <RelativeLayout
                android:layout_marginTop="30dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
            <com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
                android:id="@+id/adView"
                android:layout_centerHorizontal="true"
                android:layout_width="320dp"
                android:layout_height="50dp"
                ads:adSize="BANNER"
                ads:adUnitId="@string/admain" />
            </RelativeLayout>
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>

</LinearLayout>

This is what I called advertising in the main action

MobileAds.initialize(getApplicationContext(), getString(R.string.appid));
mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().addTestDevice(getResources().getString(R.string.test)).build();
mAdView.loadAd(adRequest);

This is gradle

    compile 'com.google.firebase:firebase-ads:10.0.1'

}
apply plugin: 'com.google.gms.google-services'

--- Later added ---

After displaying ads. My account is later blocked. A month later, she is now active. Applications that I made before blocking do not show ads. But new applications show ads without any problems.

, - . !

+4
2

, . packagename, , .

, , , !

0

. AdMob. AdMob .

→ →

, -, .

+2

Source: https://habr.com/ru/post/1668131/


All Articles