gpt4 book ai didi

android - 无法显示 AdMob 横幅,收到错误 HTTP 响应代码 : 400 etc

转载 作者:太空狗 更新时间:2023-10-29 16:01:49 25 4
gpt4 key购买 nike

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

第一台设备:

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( )

第二个设备:

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 也未获得任何积极结果。你们最终可以发布任何提示吗?提前谢谢你。

最佳答案

我有同样的问题。在我更新 AdMob 帐户中的结算和付款详细信息后,它开始为我工作。

关于android - 无法显示 AdMob 横幅,收到错误 HTTP 响应代码 : 400 etc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29208539/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com