gpt4 book ai didi

android - 解决 AdMobs 问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:02:41 48 4
gpt4 key购买 nike

我在开始使用 AdMobs 时遇到了一些奇怪的问题。

第一个问题

当我尝试通过此代码添加横幅时:

        layout = (RelativeLayout) findViewById(R.id.adprincipal);
adView = new AdView(this);
adView.setAdUnitId("my unit id");
adView.setAdSize(AdSize.BANNER);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("my device")
.build();
// Load the adView with the ad request.
adView.loadAd(adRequest);
layout.addView(adView);

如果我设置大小AdSize.SMART_BANNER,我什么也得不到,但我得到一个带有AdSize.BANNER的测试横幅,但无论如何(甚至BANNER和SMART_BANNER)这个是我从 LogCat 得到的:

当横幅

12-30 04:41:00.380: W/ResourceType(27407): getEntry failing because entryIndex 13 is beyond type entryCount 5

12-30 04:41:00.380: W/ResourceType(27407): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647)

12-30 04:41:00.380: E/GooglePlayServicesUtil(27407): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

12-30 04:41:00.400: W/ResourceType(27407): getEntry failing because entryIndex 13 is beyond type entryCount 5

12-30 04:41:00.400: W/ResourceType(27407): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647)

12-30 04:41:00.400: E/GooglePlayServicesUtil(27407): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

12-30 04:41:02.111: I/GATE(27407): DEV_ACTION_COMPLETED

12-30 04:41:02.111: I/Ads(27407): Ad finished loading.

当 SMART_BANNER

12-30 04:48:27.476: W/ResourceType(29507): getEntry failing because entryIndex 13 is beyond type entryCount 5

12-30 04:48:27.476: W/ResourceType(29507): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647)

12-30 04:48:27.476: E/GooglePlayServicesUtil(29507): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

12-30 04:48:27.516: D/OpenGLRenderer(29507): Enabling debug mode 0

12-30 04:48:27.576: W/ResourceType(29507): getEntry failing because entryIndex 13 is beyond type entryCount 5

12-30 04:48:27.576: W/ResourceType(29507): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647)

12-30 04:48:27.576: E/GooglePlayServicesUtil(29507): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

12-30 04:48:31.450: I/Ads(29507): No fill from ad server.

12-30 04:48:31.450: W/Ads(29507): Failed to load ad: 3

12-30 04:48:31.450: E/SQLiteLog(29507): (14) cannot open file at line 30241 of [00bb9c9ce4]

12-30 04:48:31.450: E/SQLiteLog(29507): (14) os_unix.c:30241: (2) open(/NotificationPermissions.db) -

12-30 04:48:31.450: D/WebKit(29507): ERROR:

12-30 04:48:31.450: D/WebKit(29507): SQLite database failed to load from /NotificationPermissions.db

12-30 04:48:31.450: D/WebKit(29507): Cause - unable to open database file

12-30 04:48:31.450: D/WebKit(29507): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)

SMART BANNER 没有加载

第二个问题

我遇到的错误与“BANNER”设置 INTERSTITIAL 的错误相同,但它最终也加载了...

怎么了??

我试过:this , thisthis我已经重新安装了我的库,下载了 lastet,删除并重新安装...等等。

谢谢。

最佳答案

在模拟器上更改如下:

AdRequest adRequest = new AdRequest.Builder()  
.addTestDevice("my device")
.build();

AdRequest request = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) // All emulators
.addTestDevice("B3EEABB8EE11C2BE770B684D95219ECB") // Emulator id you will get in the LogCat verbose
.build();
adView.loadAd(request);

在真实设备上:

adView.loadAd(new AdRequest.Builder().build());

此外,请检查您的广告服务器(最有可能是 AdMob),看您的 ad_unit_id 的广告是否启用了横幅、智能横幅和插播广告。

关于android - 解决 AdMobs 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20840623/

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