簡體   English   中英

廣告未顯示,錯誤403

[英]Ads not displaying, error 403

Admob沒有為我的應用展示廣告。測試廣告正在展示,但真正的廣告卻沒有。

如果我的帳戶被禁用,則應顯示此錯誤。 但我可以登錄我的admob帳戶。

我也在不同帳戶的其他手機上進行了測試,但也有不同的連接但仍無用。

這是日志

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

---后來補充---

這是布局文件

<?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>

這就是我在主要活動中調用廣告的方式

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);

這是一種謎語

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

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

---后來補充---

廣告展示后。 后來我的帳戶被封鎖。一個月后它現在活躍了。 我在阻止之前制作的應用不會展示廣告。 但新應用正在展示沒有任何問題的廣告。

我認為唯一可行的解​​決方案是將package-name更改為另一個。 它對我有用!

這也發生在我正在進行的項目中。 就我而言,這是由於AdMob缺乏個人信息造成的。 在AdMob控制台上輸入以下信息后,廣告開始正常顯示。

設置 - >聯系人姓名

付款 - >管理設置 - >商家名稱和地址

我希望這能幫助那些面臨這個問題的人。

我找到了解決上述問題的可行解決方案。 我用不同的包名構建了應用程序,並放置了不同的廣告單元,問題解決了!!

不是一個完美的解決方案,但希望這有幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM