无法显示 AdMob 横幅,收到错误 HTTP 响应代码:400 等 [英] Cannot display AdMob banners, Received error HTTP response code: 400 etc

查看:23
本文介绍了无法显示 AdMob 横幅,收到错误 HTTP 响应代码:400 等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我做什么,我都无法显示来自 Admob 的横幅,我在两种不同的 Android 设备上进行了测试,结果如下:

Whatever I do I cannot display the banners from Admob, I tested on two Android different devices and here is what I get:

第一台设备:

I/Ads     ( 8161): Starting ad request.
I/Ads     ( 8161): Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
I/Ads     ( 1006): CsiReporterFactory: CSI is not enabled. No CSI reporter created.
W/Ads     ( 1006): JS: The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=0&request_id=............
W/Ads     ( 1006):  (null:1)
W/Web Console( 1006): The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=0&request_id=............
W/Ads     ( 1006): JS: The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=0&request_id=............
W/Ads     ( 1006):  (null:1)
W/Web Console( 1006): The page at about:blank displayed insecure content from gmsg://mobileads.google.com/loadAdURL?drt_include=0&request_id=............
W/Ads     ( 1006): JS: The page at https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html displayed insecure content from file:///android_asset/webkit/android-weberror.png.
W/Ads     ( 1006):  (null:1)
W/Ads     ( 1006): Received error HTTP response code: 400
W/Ads     ( 8161): There was a problem getting an ad response. ErrorCode: 0
W/Ads     ( 8161): Failed to load ad: 0

注意:这里既没有调用 onAdLoaded( ) 也没有调用 onAdFailedToLoad( )

Note: here neither onAdLoaded( ) nor onAdFailedToLoad( ) is getting called

第二台设备:

I/Ads     ( 1165): CsiReporterFactory: CSI is not enabled. No CSI reporter created.
I/Ads     ( 1165): Starting ad request.
I/Ads     ( 1165): Use AdRequest.Builder.addTestDevice("XXXXXXXXXXXXXXXXXXXXXXXXXX") to get test ads on this device.     
I/Ads     ( 1165): CsiReporterFactory: CSI is not enabled. No CSI reporter created.
W/Ads     ( 1165): There was a problem getting an ad response. ErrorCode: 2
I/Ads     ( 1165): Scheduling ad refresh 60000 milliseconds from now.
W/Ads     ( 1165): Failed to load ad: 2

我的代码:

protected void onCreate( Bundle icicle )
{
 super.onCreate( icicle );

m_glView = initOpenGLView( ); 

 m_adMobView = new AdView( this );
 m_adMobView.setAdSize( AdSize.SMART_BANNER );
 m_adMobView.setAdUnitId( "XXXXXXXXXXXXXXXXXX" );      <----I just replaced the ID with XXX for this example
 m_adMobView.setAdListener( new AdListener( )
  {
   public void onAdLoaded( ) 
   { 
    egNative.LogMessage( "ADMob::onAdLoaded" );
   };
   public void onAdFailedToLoad( )
   {
    egNative.LogMessage( "ADMob::onAdFailedToLoad" );
   }
  }  );

 FrameLayout layout = new FrameLayout( getApplicationContext( ) );
 layout.addView( m_glView );

 int gravity = android.view.Gravity.CENTER_HORIZONTAL | android.view.Gravity.TOP;
 FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT , 
            FrameLayout.LayoutParams.WRAP_CONTENT ,  gravity );
  layout.addView( m_adMobView , params );
setContentView( layout );
}

@Override protected void onStart( )
 {
  super.onStart( );
  AdRequest.Builder ad_builder = new AdRequest.Builder( );
  m_adMobView.loadAd( ad_builder.build( ) );
 }

我正在运行最新版本的 Google Play 服务.还仔细检查了广告单元 ID,它们很好.测试广告单元 ID 也没有得到任何积极的结果.你们最终可以发布任何提示吗?提前谢谢你.

I am running the latest version of Google Play services. Also have double checked the Ad unit IDs and they're fine. Not getting any positive results with test Ad unit IDs too. Can you guys post any hints eventually? Thank you in advance.

推荐答案

您的包裹被 Google AdMob 阻止.如果您收到这样的电子邮件:

Your package is blocked by Google AdMob. If you received a email like this:

你好,

这封电子邮件是为了提醒您,您的一个应用程序不是目前符合我们的 AdMob 计划政策,并且作为结果,您的应用程序中的广告服务已被禁用.

This email is to alert you that one of your applications is not currently in compliance with our AdMob program policies and as a result, ad serving has been disabled to your application.

问题 ID#:33943***

Issue ID#: 33943***

已禁止向以下对象投放广告:APPNAME(com.example.pack)

Ad serving has been disabled to: APPNAME (com.example.pack)

需要采取的措施:检查您的所有其他剩余应用程序说明合规性.

Action required: Check all other remaining applications in your account for compliance.

当前帐户状态:有效

违规说明

GOOGLE PLAY 删除:AdMob 发布商不得滥用或宣传滥用任何 Google 产品,例如 Google Play、YouTube、或博主.这包括规避或提供手段规避这些或其他 Google 产品的政策或条款,例如允许用户下载 YouTube 视频.

GOOGLE PLAY REMOVAL: AdMob publishers are not permitted to abuse or promote the abuse of any Google product, such as Google Play, YouTube, or Blogger. This includes circumventing, or providing the means to circumvent, the policies or terms of these or other Google products, such as by allowing users to download YouTube videos.

如果您的应用因 Google Play 政策执行而被移除,请在此处联系 Google Play 以了解应用程序的删除.如果谷歌播放恢复您的应用,请向我们的团队提交申诉.

If your app is removed by Google Play policy enforcement, please contact Google Play about an app removal here. If Google Play reinstates your app, please submit an appeal to our team.

需要采取的行动:检查帐户是否合规

Action required: Check account for compliance

虽然上述应用已停用广告投放,但您的 AdMob帐户保持活动状态.我们建议您花时间审查其余的应用程序,以确保它们合规遵守我们的政策,并相应地监控您的应用程序以减少我们未来发送政策电子邮件的可能性.另外,请注意我们的团队保留随时禁用帐户的权利,如果我们继续看到违规行为发生.

While ad serving has been disabled to the above app, your AdMob account remains active. We suggest that you take the time to review the rest of your applications to ensure that they’re in compliance with our policies, and to monitor your apps accordingly to reduce the likelihood of future policy emails from us. Additionally, please note that our team reserves the right to disable accounts at any time if we continue to see violations occurring.

上诉

如果您希望对此禁用提出上诉,则可以使用我们的申诉表.

If you wish to appeal this disabling then you can do so by using our appeal form.

感谢您的合作.

此致,

Google AdMob 团队

The Google AdMob Team

所以现在您需要更改您的应用程序包.在 Eclipse 上它是 AndroidManifest.xml 文件中的 package="com.example"

So now you need to change your package of your app. on eclipse it is package="com.example" in AndroidManifest.xml file

在 AndroidStudio 上 applicationId "com.example" 在 build.gradle 文件中

on AndroidStudio applicationId "com.example" in build.gradle file

这篇关于无法显示 AdMob 横幅,收到错误 HTTP 响应代码:400 等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆