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 错误


- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01