问题描述
我尝试通过在设备中运行 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 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!