2017-03-07 72 views
1

非常に多くのことを試みました。そう簡単に見えるもので一日を無駄にした。 アプリを開くと広告が表示されません。「広告は表示されません。広告が表示されません」

すべてがエラーなく機能しますが、広告はまったく表示されません。

コードとlogcat

MainActivity.java

protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    MobileAds.initialize(getApplicationContext(), "***"); 


    // " *** " is replacement for AdID and AdunitID 
    setContentView(R.layout.activity_main); 


    adView = (AdView)this.findViewById(R.id.adView); 
    AdRequest adRequest = new AdRequest.Builder() 
      .addTestDevice("45051C497E3954E140EC02E9C7B31B3C") 
      .build(); 

    adView.loadAd(adRequest); 

} 

XMLを次のようにLogcat

<RelativeLayout 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/res-auto" 


    android:id="@+id/activity_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="16dp" 
    android:paddingRight="16dp" 
    android:paddingTop="16dp" 
    android:paddingBottom="16dp" 
    tools:context="a1440.MainActivity" 
    android:elevation="1dp" 
    android:padding="15dp"> 


    <com.google.android.gms.ads.AdView 
     android:id="@+id/adView" 
     ads:adSize = "BANNER" 
     ads:adUnitId= "******" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="16dp" /> 

を:

W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 16437 

I/chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest  
https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.appcache", source:  htt://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0) 

I/chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source:  htt://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0) 

I/chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source:  htt://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0) 

I/Ads: Ad is not visible. Not refreshing ad. I/Ads: Scheduling ad refresh 60000 milliseconds from now. I/Ads: Ad is not visible. Not  refreshing ad. 

I/Ads: Scheduling ad refresh 60000 milliseconds from  now. 
+0

MainActivityで 'adView.onResume()'、 'onPause()'などの呼び出しをしていますか? – Sufian

答えて

0

RelativeLayoutの左右の詰め物が宣言されています。これは、ほとんどの場合、AdViewの水平方向の余地がほとんど残っていません。

+0

それは非常に巧妙な推測ですが、いまだにうまくいきません。私は新鮮なダミープロジェクトでそれを作ろうとしましたが、まだ広告は見えませんでした。私はプレイサービスとすべてをインストールしています。 –

+0

'RelativeLayout'と' AdView'からすべてのパディングを削除しましたか? – William

+0

はい私はしました。パディングなし。私は確かにそれを上回っていたイメージビューを削除しました。 –

関連する問題