AdMob banner ad not showing(AdMob 横幅广告未显示)
问题描述
我在我的应用程序中使用 admob,它运行良好,但突然停止显示广告.下面是我使用的代码:
I am using admob in my app, it was working fine but suddenly it stopped showing ads at all. Bellow is my codes i used:
mainActivity.xml:
mainActivity.xml:
<com.google.android.gms.ads.AdView
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="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
MainActivity.java
MainActivity.java
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
AndroidManifest:
AndroidManifest:
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
我按照 adMob 网站的所有说明进行操作,正如我几天前所说的那样.
I followed all the instructions from adMob site as i said it was working few days ago.
下面是 logcat 中可能与我的问题有关的几行:
Bellow are few line from logcat which may be related to my issue:
09-25 22:44:50.292: E/dalvikvm(18554): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
<小时>
09-25 22:45:07.209: E/Ads(18554): JS: Uncaught ReferenceError: renderAd is not defined (https://googleads.g.doubleclick.net/mads/gma:1)
09-25 22:45:07.209: E/Web Console(18554): Uncaught ReferenceError: renderAd is not defined:1
09-25 22:45:07.209: E/Ads(18554): JS: Uncaught ReferenceError: onLoad is not defined (https://googleads.g.doubleclick.net/mads/gma:1)
09-25 22:45:07.209: E/Web Console(18554): Uncaught ReferenceError: onLoad is not defined:1
<小时>
我反复收到以下警告,当我点击应该展示广告的空白区域时,它会出现更多
I get bellow warning repeatedly and it appears more when i click the blank area where ad should be showing
09-25 22:46:10.911: W/PicturePileLayerContent(18554): Warning: painting PicturePile without content!
<小时>
这是用广告"过滤的 logcat
This is filtered logcat with "ads"
09-25 23:39:25.948: I/Ads(28874): Starting ad request.
09-25 23:39:25.948: I/Ads(28874): Use AdRequest.Builder.addTestDevice("8FCD71CAAE776558876AAA9BA964245A") to get test ads on this device.
09-25 23:39:26.919: I/Ads(22050): App index is not enabled
09-25 23:39:30.432: E/Ads(28874): JS: Uncaught ReferenceError: renderAd is not defined (https://googleads.g.doubleclick.net/mads/gma:1)
09-25 23:39:30.442: E/Ads(28874): JS: Uncaught ReferenceError: onLoad is not defined (https://googleads.g.doubleclick.net/mads/gma:1)
09-25 23:39:30.442: I/Ads(28874): Scheduling ad refresh 60000 milliseconds from now.
09-25 23:39:30.472: I/Ads(28874): Ad finished loading.
我到处搜索解决方案,还查看了一些类似但没有帮助我的方法.
I have searched everywhere for the solution and also looked at some similar but non of them helped me.
推荐答案
这个问题是通过手动卸载应用程序并重新安装而不做任何更改来解决的!
This problem is solved by uninstalling the app manually and reinstalling again without making any changes!!
这篇关于AdMob 横幅广告未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:AdMob 横幅广告未显示
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01