2017-06-13 12 views
1

テストID付きのバナー広告をテストしたところ、adUnitIdをAdMobが私と私に与えた実際のIDに変更するために成功したアプリケーションクラス内の初期化されたMobileAds。 Playストアで自分のアプリを公開し、AdMobにリンクし、支払いプロフィールを設定しました。 AdMobによると、バナー広告はアクティブですが、アプリをダウンロードして再インストールしても広告は表示されません。私はいくつかのステップを逃すことができますか?Android AdMobパネルでは、バナー広告はアクティブだが、アプリには表示されない

関連するコード:

これは、アプリケーションクラスである:

public class MyApplication extends Application { 

    @Override 
    public void onCreate() { 
     super.onCreate(); 

     MobileAds.initialize(getApplicationContext(), "ca-app-pub-8983537837429131~3925299209"); 

    } 

バナー広告を表示するようになっているアクティビティ:

public class EntryActivity extends AppCompatActivity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_entry); 

     Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar); 
     setSupportActionBar(toolbar); 
     getSupportActionBar().setDisplayHomeAsUpEnabled(true); 

     final AdView adView = (AdView)this.findViewById(R.id.adView); 

     AdRequest adRequest = new AdRequest.Builder().build(); 

     adView.loadAd(adRequest); 
} 

をし、XMLです:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    android:id="@+id/entryActivityLayout" 
    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" 
    xmlns:ads="http://schemas.android.com/apk/libs/com.google.ads‌​" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    tools:context="com.bastardo.francisco.fitjournal.activities.EntryActivity"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/my_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     android:elevation="4dp" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> 


    <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" 
     android:layout_centerHorizontal="true" 
     android:layout_alignParentBottom="true" 
     ads:adSize="BANNER" 
     ads:adUnitId="My-banner-ad-Id"/> 

</RelativeLayout> 

私が言ったように、テスト広告はうまく表示されていましたが、実際の広告は表示されません。私のアプリはAdMobのプレイストアとリンクしており、支払いプロフィールを設定済みです。他のステップはありますか?アプリが表示されるのをどれくらい待たなければならないのですか?

+0

ログに何かが表示されますか? –

+0

デバイスを接続してログキャッチを1分視聴しましたが、何も表示されません。とにかく友人は広告を見ることができると私に言った。私は開発者だから見えないかもしれない? –

答えて

0

いつか広告が表示されるまでに数時間かかる場合があります。これは、関連する広告をアプリに表示するのに十分なデータがないためです。

アプリが現在プレイストアにある場合は、別のGoogleアカウントで他の端末にダウンロードしてください。問題がないように広告を表示できます。

+0

他の誰もが私以外の広告を見ることができます。 Googleアカウントがデベロッパーアカウントと同じであるためかもしれません。とにかく、ありがとう! –

+0

また、私はあなたがあなたのアプリのデバッグバージョン(Androidスタジオがあなたがideからアプリを走らせる)を実行しているならば、広告は「秘密」の理由で表示されないので、あなた自身の広告をクリックすると禁止される危険はありませんが、とにかくそれをクリックしないでください。 –

関連する問題