admob error due to attrs.xml in android(由于 android 中的 attrs.xml 导致的 admob 错误)
问题描述
我尝试通过在设备中运行 Admob 在我的应用程序中使用它,但它什么也没显示,我在 logcat 中发现了以下错误
i tried using Admob in my app by running it in a device and it showed nothing and i found the followig error in logcat
04-07 10:49:05.570: ERROR/Ads(1084): AdView missing required XML attribute adUnitId.
在 attrs.xml 文件中我有以下几行
in attrs.xml file i have the following lines
<?xml version="1.0" encoding="utf-8"?>
<declare-styleable name="com.google.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
我的错误是什么...
我的应用程序中总共有 4 个活动,我正在尝试在我的第 4 个活动中添加 admob.我是否必须在该活动中添加上述行或其他任何内容,请帮助我的朋友...
I have totally 4 Activities in my App and i am trying to add the admob in my 4th activity. whether i have to add the above said lines with that activity or anything else pls help me friends...
推荐答案
我照说 here 并且它开始工作了.(在我问这个问题很久之前,我没有得到任何答案的成功,我离开了它,当我尝试现在它可以工作......)
i followed as said here and it get worked. (long time before i asked this ques, i dint get success with any of the answer and i left it, when i tried now it works...)
这篇关于由于 android 中的 attrs.xml 导致的 admob 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:由于 android 中的 attrs.xml 导致的 admob 错误


基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01