【问题标题】:Google Play services version issue! Working app with admob ads has stopped showing adsGoogle Play 服务版本问题!正在使用 admob 广告的应用程序已停止显示广告
【发布时间】:2014-09-18 17:04:12
【问题描述】:

我最近向 Play 商店发布了一个应用程序,集成了 Play 服务以显示 admob 广告,检查了测试广告并更新到了 Play 商店。 该应用程序显示一个不错的数字。每天的广告展示次数和收入开始回升。

但是,从 9 月 15 日开始,展示次数突然下降。我检查了加载失败的测试广告

代码如下:

类文件

public class MyActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my);

    AdView adView = (AdView) this.findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().addTestDevice("xxxxxxxxxxxxxxxxxxxx").build();  
             adView.loadAd(adRequest);


   .
   .
   .
   .

}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.my, menu);
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.action_share:
            Intent share = new Intent(android.content.Intent.ACTION_SEND);
            share.setType("text/plain");
            share.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                            share.putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=com.akshitrewari.gateexampreparation");

            startActivity(Intent.createChooser(share, "Share This App!"));
            return true;
        case R.id.action_settings:
            Intent intent1 = new Intent(getApplicationContext(), Setting.class);
            startActivity(intent1);
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }


}

}

XML 文件

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
.
.
.
.
  >


<ListView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/listView1"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="60dp" />

<com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="ca-app-pub-xxxxxxxxxxxxxxx/xxxxxx"
    ads:adSize="BANNER"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />


</RelativeLayout>

日志(我在 8 月 26 日没有收到此错误,测试广告加载完美。现在我在 2014 年 9 月 18 日收到此错误

09-18 21:40:41.213    4016-4046/com.akshitrewari.gateexampreparation W/Ads﹕ Could not parse mediation config: {"ad_networks":[{"adapters":["com.google.DummyAdapter"],"allocation_id":"3735928559","data":{"gwhirl_share_location":"1"}}],"ad_type":"banner","qdata":"AJ5UM1lXCnTUhRTWdw1mn4N95P_d_H-dEl_XiuUswrMv-H_rTF-JkILfa5s-hbfPPseQD7178XqHBSpH-ONAihbPOYwWiKy-76Zl8NNtcHeoy-5i1Q","settings":{"click_urls":["http://e.admob.com/clk?qdata=@gw_qdata@&js=@gw_sdkver@&session_id=@gw_sessid@&seq_num=@gw_seqnum@&adt=@gw_adt@&aec=@gw_aec@&ad_network_id=@gw_adnetid@&allocation_id=@gw_allocid@&nr=@gw_adnetrefresh@&client=ca-app-pub-xxxxxxxxxx&slotname=xxxxxxx"],"imp_urls":["http://e.admob.com/imp?qdata=@gw_qdata@&js=@gw_sdkver@&session_id=@gw_sessid@&seq_num=@gw_seqnum@&adt=@gw_adt@&aec=@gw_aec@&ad_network_id=@gw_adnetid@&allocation_id=@gw_allocid@&nr=@gw_adnetrefresh@&client=ca-app-pub-xxxxxxxxxxx&slotname=xxxxxxx"],"nofill_urls":["http://e.admob.com/nofill?qdata=@gw_qdata@&js=@gw_sdkver@&session_id=@gw_sessid@&seq_num=@gw_seqnum@&adt=@gw_adt@&aec=@gw_aec@&client=ca-app-pub-xxxxxxxx&slotname=xxxxxxxx"],"refresh":60}}
09-18 21:40:41.233    4016-4016/com.akshitrewari.gateexampreparation W/Ads﹕ Failed to load ad: 0

以上部分日志出现在RED中

依赖

compile 'com.google.android.gms:play-services:4.4.52'

我使用这里建议的 4.4.52 版本,因为 v 5.0.77 出现错误

Android Studio & AdMob -- The following classes could not be instantiated

Android 清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.akshitrewari.gateexampreparation" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
// to download ads from internet
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
//Add Home screen Shortcut
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity
        android:name=".MyActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
.
.
.
.

    <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
    </activity>
</application>

</manifest>

请注意,此代码工作 100% 正常,该应用已发布并产生了可观的收入,但现在无法正常工作,每天的收入几乎为零(该应用仍在产生与一周前相比,印象数减少了 20%。这意味着一些设备仍在接收广告,但大多数没有。今天仪表板上显示的填充率为 99%)

我不确定代码如何在测试后仅 20 天就停止工作,但这可能是由于 google play 服务的更新。当我上次测试它时,它是在 2014 年 8 月 26 日工作的。

但是,完全相同的代码在我的其他应用中运行!!

更新:我确实屏蔽了某个类别的广告,这些广告占展示次数的很大比例但没有收入(我知道我的应用程序的受众对该类别根本不感兴趣)。虽然这与问题没有任何联系,但问题发生在我这样做的一天后。我在取消屏蔽该类别后尝试过,但仍然没有测试广告。

该应用的当前安装量没有下降。事实上,它呈指数级增长。

如果有人知道为什么这段代码现在不起作用以及如何更正,请告诉我。

我想解决这个问题并尽快更新应用程序

【问题讨论】:

  • 您能添加您的 AndroidManfiest,特别是与广告相关的任何部分吗?
  • @ianhanniballake : 我已经添加了 android manifest 文件(只省略了一长串活动)
  • 您开始使用中介了吗?就像在中介中设置了另一个广告网络,但没有将其库包含在您的应用中。
  • @Kunalxigxag :不,我没有做任何与调解有关的事情,我只使用 admob。我什至没有在任何其他广告网络上注册
  • 链接到有问题的应用?

标签: android admob google-play-services


【解决方案1】:

我刚刚下载了您的应用并收到了一条广告。您必须重新启用您之前阻止的那些类别。

我坚信这与您屏蔽某类广告的更改有关。这个错误基本上意味着No Fill

当 AdMob 没有填充,并且您的中介链中没有其他网络时,服务器当前正在发回带有“com.google.DummyAdapter”的此配置。为什么 SDK 无法解析该配置对我来说仍然是个谜,但是当它按预期工作时,您只会看到“加载广告失败:3”的日志语句。

【讨论】:

  • 我在问题中提到有一些广告展示,这意味着某些具有特定版本播放服务的手机会显示广告,而有些则不会。但是,我在某处读到,无论填充率或被屏蔽的广告类别如何,都应始终提供 TEST 广告
  • 不管怎样,我肯定想升级到最新版本的谷歌播放服务(5.0.77 或 5.2.8)你能看看这个问题吗,因为我认为不使用最新的播放服务可能是一个问题stackoverflow.com/questions/24587991/…
  • 代码现在可以正常工作,无需进行任何更改。看我的回答
  • 我在测试广告方面遇到问题,我不明白原因。即使使用测试广告单元 ID,它也不起作用。
【解决方案2】:

看起来这只是一个临时问题,广告编码没有错误。

错误时间线

8 月 26 日:我集成了 admob,收到了测试广告并上传了应用程序。

9 月 13 日:我屏蔽了一类广告

9 月 14 日至 15 日:展示次数突然下降,我尝试测试应用并没有得到任何测试广告,并且在 logcat 中得到错误代码

9 月 18 日:我在这里问了问题

9 月 18 日至 28 日:尚无解决方案

9 月 29 日:我正在使用相同的代码获得测试广告,admob 仪表板中的展示次数增加了

在整个问题中,我没有对广告代码进行任何更改,目前,截至今天,我在 Play 商店中的应用与我上个月首次集成 admob 时上传的版本相同,现在它显示了很多广告展示次数。我在 9 月 13 日屏蔽的广告类别仍然被屏蔽,与此问题无关。我仍然不明白为什么代码在十天内停止工作。可能是谷歌的东西吗?

感谢 Eric Leichtenschlag 和 ianhanniballake 提供的帮助 :)

【讨论】:

  • 过去 48 小时内现在遇到同样的问题。 AdMob 是我们的主要收入来源,我们不能半个月没有收入。与代表取得联系,但尚未解决。令人沮丧!
【解决方案3】:

解决此问题的方法是在 admob 上创建一个新的广告单元并改用该 ID

【讨论】:

  • 在发布问题之前已经尝试过了。它与广告单元无关。另外,在回答之前,你有没有读到这是一个临时问题,它会自动解决??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-05-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多