【问题标题】:admob doesn't work on EMulator Android 2.2 eclipseadmob 在模拟器 Android 2.2 eclipse 上不起作用
【发布时间】:2014-10-30 15:05:08
【问题描述】:

我读了很多,但什么都没有……

我没有注册我的应用,我想在支付 25 美元后测试 admob....

我的主要活动

AdView adview = (AdView)findViewById(R.id.adView);
    AdRequest re = new AdRequest();
    re.addTestDevice(AdRequest.TEST_EMULATOR);
    re.setTesting(true);
    adview.loadAd(re);  

我的 xml 文件

xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

<com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/bt_txt2"
        android:layout_below="@+id/bt_txt2"
        ads:adSize="BANNER"
        ads:adUnitId="pub-11072202---------"
        ads:loadAdOnCreate="true"
        ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" >

    </com.google.ads.AdView>   

muy 清单文件

 <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

我将 googleadmobadssdk 6.4.1.jar 添加到库中

原木猫说....

Failed to provider info for com.googleandroid.gms.ads.adinfo
Can't get the viewWindth ater the first layout
no AdResponse foud, <message: /jsLoaded>

Invalid unknow request error: Cannot detenmine request type. is your ad unit id correct

【问题讨论】:

    标签: android eclipse admob logcat userid


    【解决方案1】:

    看这个链接:https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start

    它说它至少需要 api 9 (android 2.3)

    我不知道为什么你还需要支持 android 2.2(根据这个只有 0.7%:https://developer.android.com/about/dashboards/index.html

    希望对你有帮助

    【讨论】:

    • @R114 而“this”是 Google 的官方数据,请放心。
    【解决方案2】:

    从您发布的代码xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 我可以看出您使用的是过时的 Admob Sdk

    你应该做的是将你的代码迁移到google play services admob,查看官方指南:https://developers.google.com/mobile-ads-sdk/docs/admob/android/play-migration

    你也应该放弃对 API 8 的支持,真的。

    【讨论】:

    • 点击问题旁边的接受图标✓是stackoverflow表达“谢谢”的方式;-) @R114
    猜你喜欢
    • 2012-08-11
    • 1970-01-01
    • 1970-01-01
    • 2011-12-05
    • 1970-01-01
    • 2016-06-29
    • 1970-01-01
    • 2011-08-10
    • 1970-01-01
    相关资源
    最近更新 更多