【发布时间】:2013-12-30 13:33:43
【问题描述】:
我在使用 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 失败,因为 entryIndex 13 超出了类型 entryCount 5
12-30 04:41:00.380:W/ResourceType(27407):无法在包 0 中获取 0x7f0b000d (t=10 e=13) 的条目(错误 -2147483647)
12-30 04:41:00.380:E/GooglePlayServicesUtil(27407):未找到 Google Play 服务资源。检查您的项目配置以确保包含资源。
12-30 04:41:00.400:W/ResourceType(27407):getEntry 失败,因为 entryIndex 13 超出了类型 entryCount 5
12-30 04:41:00.400: W/ResourceType(27407): 在包 0 中获取 0x7f0b000d (t=10 e=13) 的条目失败(错误 -2147483647)
12-30 04:41:00.400:E/GooglePlayServicesUtil(27407):未找到 Google Play 服务资源。检查您的项目配置以确保包含资源。
12-30 04:41:02.111:I/GATE(27407):DEV_ACTION_COMPLETED
12-30 04:41:02.111:I/Ads(27407):广告已完成加载。
当 SMART_BANNER
12-30 04:48:27.476:W/ResourceType(29507):getEntry 失败,因为 entryIndex 13 超出了类型 entryCount 5
12-30 04:48:27.476: W/ResourceType(29507): 在包 0 中获取 0x7f0b000d (t=10 e=13) 的条目失败(错误 -2147483647)
12-30 04:48:27.476:E/GooglePlayServicesUtil(29507):未找到 Google Play 服务资源。检查您的项目配置以确保包含资源。
12-30 04:48:27.516:D/OpenGLRenderer(29507):启用调试模式 0
12-30 04:48:27.576:W/ResourceType(29507):getEntry 失败,因为 entryIndex 13 超出了类型 entryCount 5
12-30 04:48:27.576: W/ResourceType(29507): 在包 0 中获取 0x7f0b000d (t=10 e=13) 的条目失败(错误 -2147483647)
12-30 04:48:27.576:E/GooglePlayServicesUtil(29507):未找到 Google Play 服务资源。检查您的项目配置以确保包含资源。
12-30 04:48:31.450:I/Ads(29507):没有来自广告服务器的填充。
12-30 04:48:31.450:W/Ads(29507):未能加载广告:3
12-30 04:48:31.450: E/SQLiteLog(29507): (14) 无法在 [00bb9c9ce4] 的第 30241 行打开文件
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):错误:
12-30 04:48:31.450: D/WebKit(29507): SQLite 数据库无法从 /NotificationPermissions.db 加载
12-30 04:48:31.450:D/WebKit(29507):原因 - 无法打开数据库文件
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)
智能横幅无法加载
第二个问题
我遇到的错误与设置 INTERSTITIAL 的“BANNER”相同,但它最终也会加载...
怎么了??
我试过了:this、this 和 this 我已经重新安装了我的库,下载了 lastet,删除并重新安装了......等等。
谢谢。
【问题讨论】:
-
你在什么设备或模拟器上运行这个应用程序?
-
感谢您的回复。始终在设备上。
-
请检查您是否安装了任何广告拦截器
标签: android admob google-play-services