【发布时间】:2019-11-11 22:06:44
【问题描述】:
我的横幅广告和插页式广告在 8 和 9 下的设备上运行良好,但在 8 或 9 上无法运行,但在我的模拟器上运行良好,在 android 9 上运行良好
我的应用在 google 上发布,我的广告在 android 8 下的设备上运行良好,但 android 8 或 9 未显示,在 android 10 的模拟器上运行良好,但在真实设备上无法运行
在mainfest
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="MyAppID" />
在gradle中
implementation 'com.google.firebase:firebase-ads:17.2.0'
在活动中
AdView adview2;
adview2 = (AdView) findViewById(R.id.adView2);
AdRequest adRequest = new AdRequest.Builder().build(); adview2.loadAd(adRequest);
在xml中
<com.google.android.gms.ads.AdView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/adView2"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="AdID"
>
</com.google.android.gms.ads.AdView>
【问题讨论】:
-
您使用的是哪个 SDK?请发布更多详细信息,最好是解释您所面临问题的代码。
-
我的应用发布在 google play 我的广告在 android 8 下的设备上运行良好,但 android 8 或 9 未显示,在 android 10 的模拟器上运行良好,但在真实设备上无法运行
-
您可以点击下面的链接,我认为它会对您有所帮助。 stackoverflow.com/questions/54955274/…
标签: android android-studio admob