0
Starting ad request. 09-16 09:31:56.827 9836-9836/com.netvariant.panic I/Ads: Use AdRequest.Builder.addTestDevice("F92724BDB6A4403A8C027B851F7DA3AF") to get test ads on this device. 09-16 09:31:58.385 9836-9849/com.netvariant.panic I/Ads: No fill from ad server. 09-16 09:31:58.392 9836-9836/com.netvariant.panic W/Ads: Failed to load ad: 3
正在此錯誤在我的xml:廣告無法加載
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:ads="http://schemas.android.com/apk/res-auto" android:id="@+id/tesd" android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.gms.ads.doubleclick.PublisherAdView android:id="@+id/ad_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" ads:adSize="BANNER" ads:adUnitId="ca-app-pub-4532549351948034/7622739505" /> </RelativeLayout>
我的Java代碼:
mAdView = (PublisherAdView) rootView.findViewById(R.id.ad_view); // Create an ad request. Check logcat output for the hashed device ID to // get test ads on a physical device. e.g. // "Use AdRequest.Builder.addTestDevice("ABCDEF") to get test ads on this device." PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build(); // Start loading the ad in the background. mAdView.loadAd(adRequest);
這就是我如何加載它。問題是什麼?謝謝。我使用我的Mac sha1創建了firebase和admob帳戶(不是我用來在商店上傳的密鑰庫).am從我的android studio運行到設備,它不工作。我在我的應用中也有google-services.json 。
我跟着這個指示
[https://firebase.google.com/docs/admob/][1]
如果我在商店上傳它,它會在沒有addtestdevice部分的情況下工作嗎? –
當您發佈應用程序時,您可以做兩件事1)註釋掉該行或2)添加變量以檢查您是處於開發模式還是生產模式。 –