2011-05-17 45 views
1

清單文件AdMob的工作不

 <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" /> 

活動類有這個 -

 AdView adView = new AdView(this, AdSize.BANNER, "xxxxxxxxxxx"); 
    // Lookup your LinearLayout assuming it’s been given 
    // the attribute android:id="@+id/mainLayout" 
    LinearLayout layout = (LinearLayout)findViewById(R.id.linearLayout02); 
    // Add the adView to it 
    layout.addView(adView); 
    // Initiate a generic request to load it with an ad 
    adView.loadAd(new AdRequest()); 
    new AdRequest().addTestDevice("CD9E4FDFA47A4AA03F9883E77C036EB3"); 

運行後我得到這個 -

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 

到底哪裏出問題了?

+0

你有最新的admob罐子嗎? – Haphazard 2011-05-17 21:59:41

+0

是的,我剛剛下載 – nasaa 2011-05-17 22:11:05

+0

這是在你的手機或模擬器?它有互聯網連接嗎? – Haphazard 2011-05-17 22:36:47

回答

0

你錯過了從您的清單

 <!-- 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> 
+0

也沒有工作。 – nasaa 2011-05-17 23:23:00

0

我的Android遊戲的「應用」部分刊登了谷歌的市場上下面,但我沒有來自AdMob得到任何印象。代碼沒有發生重大變化,甚至沒有發生任何觸及AdMob源代碼的變化,並且我的遊戲的以前版本正常運行。

事實證明問題在proguard完成的混淆處理過程中被提升。如果您使用它來執行Java符號的修改,請從proguard.cfg中刪除-optimize指令,並將其替換爲-dontoptimize