Android ADMOb不工作

Android ADMOb不工作,android,admob,Android,Admob,清单文件是 <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation" /> </application> <uses-permission android:name="android.permission.INTERNET" /> <uses-permissio

清单文件是

        <activity android:name="com.google.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
跑步后我得到了这个-

05-17 22:39:11.153: INFO/Ads(7831): adRequestUrlHtml: <html><head><script src="http://www.gstatic.com/afma/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"msid":"com.cob.fivethings","hl":"en","preqs":0,"u_so":"p","slotname":"a14dd24e71c7a34","js":"afma-sdk-a-v4.1.0","app_name":"1.android.com.cob.fivethings","isu":"CD9E4FDFA47A4AA03F9883E77C036EB3","u_audio":3,"u_w":320,"format":"320x50_mb","u_sd":1,"net":"ed","u_h":480});</script></head><body></body></html>
05-17 22:39:13.138: INFO/Ads(7831): Received ad url: <"url": "http://r.admob.com:80/ad_source.php?msid=com.cob.fivethings&hl=en&preqs=0&u_so=p&slotname=a14dd24e71c7a34&js=afma-sdk-a-v4.1.0&app_name=1.android.com.cob.fivethings&isu=CD9E4FDFA47A4AA03F9883E77C036EB3&u_audio=3&u_w=320&format=320x50_mb&u_sd=1&net=ed&u_h=480&output=html&region=mobile_app&u_tz=-60&ex=1&client_sdk=1", "afmaNotifyDt": "null">
05-17 22:39:27.058: INFO/ActivityManager(1848): Stopping service: com.android.mms/.transaction.TransactionService
05-17 22:40:11.163: INFO/Ads(7831): AdLoader timed out after 60000ms while getting the HTML.
05-17 22:40:11.193: INFO/Ads(7831): onFailedToReceiveAd(A network error occurred.)
05-17 22:43:07.343: INFO/ActivityManager(1848): Stopping service: com.android.mms/.transaction.TransactionService

出了什么问题?

您的清单的应用程序部分缺少以下内容

        <!-- The application's publisher ID assigned by AdMob -->
    <meta-data android:value="xxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" />

    <!-- AdMobActivity definition -->
    <activity android:name="com.admob.android.ads.AdMobActivity"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    android:configChanges="orientation|keyboard|keyboardHidden" />
    <!-- Track Market installs -->          
    <receiver android:name="com.admob.android.ads.analytics.InstallReceiver"
    android:exported="true">
    <intent-filter>
       <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
    </receiver>

我的Android游戏发布在谷歌的市场上,但我没有从AdMob那里得到任何印象。代码中没有明显的变化,甚至连涉及AdMob源代码的变化都没有,我的游戏的早期版本工作正常


事实证明,在proguard完成的模糊处理过程中,问题被提了出来。如果您使用它来处理Java符号的混乱,请从proguard.cfg中删除-optimize指令,改为使用-dontoptimize。

您有最新的admob jar吗?这是您的手机还是模拟器上的?它有互联网连接吗?我在谷歌集团找到了这个链接——这解释了为什么我的链接不起作用。显然,在1.5安卓手机和模拟器上,它将无法工作。当我在1.6上试用它时,它立刻就起作用了。在模拟器上一遍又一遍地得到这个结果,连续几天我都在挣扎。尽管我尽力了,但还是没能使它发挥作用。将应用程序加载到我的三星Galaxy S上,等待了至少一分钟左右,Bob的叔叔成功了。如果你的admob帐户刚刚创建,admob给你留下的印象将延迟几天。这不是你的代码问题。
        <!-- The application's publisher ID assigned by AdMob -->
    <meta-data android:value="xxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" />

    <!-- AdMobActivity definition -->
    <activity android:name="com.admob.android.ads.AdMobActivity"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    android:configChanges="orientation|keyboard|keyboardHidden" />
    <!-- Track Market installs -->          
    <receiver android:name="com.admob.android.ads.analytics.InstallReceiver"
    android:exported="true">
    <intent-filter>
       <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
    </receiver>