AdMob的4.3.1增加了显示不出来(没有AdMob的ID,但(只是为了测试),不能获得ViewWidth) [英] AdMob 4.3.1 adds not showing up (No AdMob ID yet (just for test), can't get ViewWidth)

查看:153
本文介绍了AdMob的4.3.1增加了显示不出来(没有AdMob的ID,但(只是为了测试),不能获得ViewWidth)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我知道有很多关于这个主题的问题。我找遍了所有在互联网上,但大多数的教程是关于老版本的AdMob。此外,都有一些对这个问题的不同解决方案。他们都没有为我工作。我非常非常接近获得这些测试添加到我的应用程序。他们只是没有显示出来。我收到以下错误:

First of all, I know there are a lot of questions about this topic. I searched all over the internet, but most of the tutorials are about older versions of AdMob. Also, all have some kind of different solution for the problem. They all do not work for me. I am very very close to getting these test adds into my application. They just don't show up. I get the following errors:

02-21 21:05:46.457:W / WebCore的(14924):第一个布局后无法得到viewWidth

02-21 21:05:46.457: W/webcore(14924): Can't get the viewWidth after the first layout

02-21 21:05:46.586:W /广告(14924):无效的未知请求错误:无法确定请求类型。是您的广告单元ID是否正确?

02-21 21:05:46.586: W/Ads(14924): Invalid unknown request error: Cannot determine request type. Is your ad unit id correct?

02-21 21:05:46.586:D / webviewglue(14924):nativeDestroy观点:0x685300

02-21 21:05:46.586: D/webviewglue(14924): nativeDestroy view: 0x685300

02-21 21:05:46.586:I /广告(14924):onFailedToReceiveAd(无效的谷歌广告请求)

02-21 21:05:46.586: I/Ads(14924): onFailedToReceiveAd(Invalid Google Ad request.)

我没有AdMob的发布者ID还没有,因为这将是我的第一个应用程序的市场(我首先要对市场上的APP之前,我对APP的ID)。我应该使用什么ID?目前,我有(测试在我的Andr​​oid手机):

I do not have a AdMob publisher ID yet, since this will be my first APP for the market (and I first have to have an APP on the market before I get an ID for the APP). What ID should I use? Currently I have (testing on my Android Phone):

    AdRequest adRequest = new AdRequest();
    adRequest.addTestDevice("9B08CXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    //adRequest.addTestDevice("037c7xxxxxxxxxxx"); (Not right, is from console)
    AdView adView = (AdView) this.findViewById(R.id.adView);
    adView.loadAd(adRequest);

在我的XML,我有(因为它也会发出警告viewWidth?)。它被装在一个更大的LinearLayout:

In my XML, I have (because it also warns about viewWidth?). It is packed in a bigger LinearLayout:

<LinearLayout
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="50dip">

<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/admob_pub_id"/>

</LinearLayout>

我希望这个问题足够小,但仍包含了足够的信息。

I hope the question is small enough, but still contains enough information.

在此先感谢! 种问候, 乔斯。

Thanks in advance! Kinds regards, Jos.

编辑:我已经改变了清单文件(添加权限,活动机器人:名称= ...,     机器人:configChanges = ...)。我添加的jar到一个lib文件夹并将其添加到库中。

I do have the manifest file changed (add permissions, activity android:name=..., android:configChanges=...). I added the jar to a lib-folder and added it to the libraries.

推荐答案

您不需要有一个应用程序已经在市场上获得发布者ID为新的应用程序。在Android Package的URL字段,其添加网站/应用程序的形式,只需输入市场://细节ID = your.package.name。当然,你会想更换your.package.name'与您的应用程序的实际包名称。

You don't need to have an app already on the market to get a Publisher ID for a new app. In the Android Package URL field that's on the "Add Site/App" form, just enter "market://details?id=your.package.name". You'll of course want to replace the 'your.package.name' with your app's actual package name.

在viewWidth警告罚款,你可能会插入你的Publisher ID后,仍然可以看到它们。

The viewWidth warnings are fine and you will likely still see them after inserting your Publisher ID.

这篇关于AdMob的4.3.1增加了显示不出来(没有AdMob的ID,但(只是为了测试),不能获得ViewWidth)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆