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)添加变量以检查您是处于开发模式还是生产模式。 –