我正在尝试将 AdMob 集成到我的应用程序中。这是我得到的错误......
02-01 12:34:03.184: E/Ads(23819): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
02-01 12:34:03.184: E/Ads(23819): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
02-01 12:34:03.184: E/Ads(23819): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
02-01 12:34:03.184: E/Ads(23819): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
02-01 12:34:03.184: E/Ads(23819): You must have AdActivity declared in AndroidManifest.xml with configChanges.
02-01 12:34:03.204: I/webview(23819): skipInvalidates
02-01 12:34:03.214: I/webview(23819): skipInvalidates
02-01 12:34:03.224: I/webclipboard(23819): clipservice: android.sec.clipboard.ClipboardExManager@407af360
02-01 12:34:03.714: V/webviewdatabase(23819): TCP pre connection: creating table in database
02-01 12:34:04.064: I/webview(23819): skipInvalidates
02-01 12:34:04.084: I/webview(23819): skipInvalidates
02-01 12:34:04.084: I/webclipboard(23819): clipservice: android.sec.clipboard.ClipboardExManager@407af360
02-01 12:34:04.094: I/webview(23819): skipInvalidates
02-01 12:34:04.254: I/webview(23819): skipInvalidates
这是Android清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xx.xxx"
android:versionCode="3"
android:versionName="1.1.1" >
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/icon5"
android:label="@string/app_name">
<activity
android:label="@string/app_name"
android:name=".xxx" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
<activity android:name="com.xx.xxx.History"></activity>
<activity android:name="com.xx.xxx.CommandsList"></activity>
<activity android:name="com.xx.xxx.CommandsHelp"></activity>
</application>
</manifest>
回答以上部分
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
现在应用程序执行没有任何错误,但没有显示广告。这是日志猫。有人可以告诉我,问题是什么?
02-01 12:49:15.904: I/Ads(24565): To get test ads on this device, call adRequest.addTestDevice("E0AE86FC822746EB3E5BAB6E54B48BCB");
02-01 12:49:15.984: I/webview(24565): skipInvalidates
02-01 12:49:16.104: I/Ads(24565): adRequestUrlHtml:
<html><head>
<script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL(
{"kw":[],"preqs":0,"session_id":"8235404278524521238","u_sd":1,"seq_num":"1","slotname":" a1510b61966655f","u_w":320,"msid":"com.xx.xxx","js":"afma-sdk-a-v6.2.1","mv":"8016010.com.android.vending","isu":"E0AE86FC822746EB3E5BAB6E54B48BCB","cipa":0,"bas_off":0,"format":"320x50_mb","oar":0,"net":"wi","app_name":"3.android.com.xx.xxx","hl":"en","ad_pos":{"height":0,"visible":0,"y":0,"x":0,"width":0},"gnt":2,"u_h":480,"carrier":"40413","bas_on":0,"ptime":0,"u_audio":1});</script></head><body></body></html>
02-01 12:49:17.554: W/webcore(24565): Can't get the viewWidth after the first layout
02-01 12:49:17.624: W/Ads(24565): Invalid unknown request error: Cannot determine request type. Is your ad unit id correct?
02-01 12:49:17.634: I/Ads(24565): onFailedToReceiveAd(Invalid Ad request.)
我正在使用滚动视图来显示内容。我想在内容之后在屏幕底部显示广告。我在滚动视图中使用 LinearLayout。
<LinearLayout
android:id="@+id/linearLayout9"
android:layout_width="match_parent"
android:layout_height="45px"
android:layout_marginBottom="2px"
android:background="#000000" >
<TextView
android:id="@+id/txtViewAdvertisement"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="ADVERTISEMENT"
android:textSize="16px"
android:layout_gravity="center_horizontal" />
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId=" a1510b619xxxxx"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
</LinearLayout>
如果您需要更多信息,请告诉我。
谢谢!!!
似乎问题出在我正在使用的滚动视图上。我将就此提出一个单独的问题。接受我第一部分的答案。