admob 服务器验证_AdMob服务器注册广告请求,但Ad对象包含“必须声明AdActivity”错误...
我一直在試圖將AdMob功能實(shí)施到我的項(xiàng)目中,并繼續(xù)遭遇磚墻。我一直在網(wǎng)絡(luò)上進(jìn)行研究,并注意到其他用戶所看到的類似問題以及他們的解決方案,但是我似乎得到了這么多,然后卻無法完成它的工作。我希望有人能夠指出我的一些愚蠢的錯(cuò)誤!
順便說一句,我正在運(yùn)行Android 2.3.3的HTC Desire(Bravo)上進(jìn)行測(cè)試,并使用最新的AdMob SDK(4.3.1)進(jìn)行測(cè)試。
我可以從我的AdMob帳戶看到服務(wù)器正在看到廣告請(qǐng)求,但我的應(yīng)用程序中的Ad對(duì)象一直聲明我需要在清單中聲明AdActivity以及configChange參數(shù)。兩者都在那里!
任何幫助將非常感激。下面是我的代碼的關(guān)聯(lián)(煮沸)部分;
=================== AndroidManifest.xml ============================ =====
package=""
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:debuggable="false">
android:label="@string/app_name"
android:name=".MainActivity" >
android:configChanges="orientation|keyboard|keyboardHidden"/>
====================== MainActivity.java ========================= ========package my.package.name;
import com.google.ads.AdRequest;
import com.google.ads.AdView;
public class MainActivity extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.choice_layout_main);
AdView adView = (AdView) this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest();
adView.loadAd(adRequest);
}
}================ choice_layout_main.xml ==============================
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_main"
android:gravity="top"
android:orientation="vertical"
android:scrollbarStyle="insideOverlay"
android:scrollbars="vertical"
android:textColor="#FFFFFFFF">
android:id="@+id/MainLayout"
android:padding="50sp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:backgroundColor="#000000"
ads:primaryTextColor="#FFFFFF"
ads:secondaryTextColor="#CCCCCC"
ads:adSize="BANNER"
ads:refreshInterval="30"
ads:adUnitId=""
ads:loadAdOnCreate="true"
/>
看起來,其他開發(fā)者展示的所有其他解決方案都不適合我,所以我認(rèn)為它必定是我忽略的一些愚蠢點(diǎn)!任何幫助對(duì)我的理智都會(huì)有好處!
干杯,
背風(fēng)處
總結(jié)
以上是生活随笔為你收集整理的admob 服务器验证_AdMob服务器注册广告请求,但Ad对象包含“必须声明AdActivity”错误...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 路由转发_RabbitMQ
- 下一篇: 点击展开 表格_CAD怎么将excel表