AdMob的错误,由于android系统中,以attrs.xml错误、系统、AdMob、android

2023-09-09 22:11:19 作者:饸梓.

我想在我的应用程序中使用Admob的通过在设备上运行它,它表现出什么,我发现在logcat中的followig误差

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>

什么是我的错误...

What is my error...

我完全有四项活动在我的应用程序,我想加入AdMob的在我的第4个活动。我是否需要添加上述表示与该活动或其他任何东西请行帮助我的朋友......

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...

推荐答案

我也跟着为表示的这里并得到工作。 (很长一段时间我问这个疑问句之前,我力获得成功,任何的答案,我离开它,当我试图现在它的作品...)

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...)