Google移动广告(AdMob) - 不显示任何广告

时间:2014-03-23 09:29:07

标签: java android admob google-play-services ads

我的代码看起来与原始代码(https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals?hl=en#play完全一样),我确信我已正确导入所有内容,为AndroidManifest添加了元数据,活动和权限。

当我在设备上启动应用程序时,logcat给出了以下内容:

03-23 10:18:45.874: E/GooglePlayServicesUtil(12473): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-23 10:18:45.974: D/WebView(12473): onSizeChanged - w:960 h:150
03-23 10:18:46.094: W/ActivityThread(12473): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());
03-23 10:19:17.244: E/GooglePlayServicesUtil(12473): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-23 10:19:17.265: E/GooglePlayServicesUtil(12473): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
03-23 10:20:17.243: W/Ads(12473): Timed out waiting for ad response.
03-23 10:20:17.253: E/SQLiteLog(12473): (14) cannot open file at line 32512 of [00bb9c9ce4]
03-23 10:20:17.253: I/Ads(12473): Scheduling ad refresh 60000 milliseconds from now.
03-23 10:20:17.263: W/Ads(12473): Failed to load ad: 2

未找到此Google Play服务资源且无法加载广告错误正在每分钟重复一次。

我的UnitId是正确的,我的TestDevice-Id也是。

1 个答案:

答案 0 :(得分:0)

我认为toast的消息是"无法加载(无效请求)"可能是因为您没有使用真实的广告单元ID更新字符串INSERT_YOUR_AD_UNIT_ID_HERE,您必须通过注册AdMob帐户或其他广告提供商并为您的应用申请ID来获取。