Akshit Rewari
Akshit Rewari

Reputation: 941

Google Play services version issue! Working app with admob ads has stopped showing ads

I recently published an App to the play store, integrated play services to display admob ads, checked with test ads and updated to play store. The app displayed a decent no. of ad impressions daily and earnings were starting to pick up.

However there was a sudden drop in number of impressions starting 15th sep. I checked test ads which FAILED TO LOAD

Here is the code:

Class file

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 file

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

LOG(I didn't get this error on 26th aug, test ads loaded perfectly. Now i'm getting this error on 18th sep 2014

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

The above part of log appeared in RED

Dependency

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

I used version 4.4.52 as suggested here as i was getting error with v 5.0.77

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

Android Manifest

<?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>

Please note that this code was working 100% fine , the app was published and generating decent revenue, however it is not working now and revenue per day is almost zero( the app is still generating around 20% impressions of what it used to generate a week ago. Which means some devices are still getting ads but most of them aren't. The fill rate shown on dashboard today is 99%)

I am not sure how a code can stop working just 20 days after testing , but this could be due to updating of google play services. It was working on 26th aug 2014 when I last tested it.

However , The exactly same code is working in my other app!!

UPDATE: I did block a certain category of ads which accounted for a large percentage of impressions but no revenue(I know the audience of my app isn't interested at all in that category). Although this doesn't have any link to the problem , but the problem has occured just one day after i did this. I have tried after unblocking that category but still no test ads.

There has been no drop in current installs of the app. In fact it is increasing exponentially.

Please let me know if anyone has any idea why this code is not working now and HOW TO CORRECT IT.

I want to fix this issue and update the app as soon as possible

Upvotes: 1

Views: 3061

Answers (3)

124697
124697

Reputation: 21901

The fix for this is to create a new ad unit on admob and use that id instead

Upvotes: -1

Akshit Rewari
Akshit Rewari

Reputation: 941

Looks like this was just a temporary issue and there was no error in the coding for the advertisment.

Timeline of error

26 Aug : I integrated admob , recieved test ads and uploaded app.

13 sep: I block a category of ads

14-15 sep: sudden drop in number of impressions, I try to test app and did not get any test ads and got error code in logcat

18 sep : i asked question here

18-28 sep : no solution yet

29 sep: I am getting test ads with the same code , number of impressions in admob dashboard has increased

Throughout the whole issue , I made no changes to advertisement code and currently, as of today, my app on the play store is the same version I uploaded last month when i first integrated admob and it is now showing a good number of ad impressions.The category of ads which i blocked on 13 sep is still blocked and has nothing to do with this issue. What i still dont understand is why the code stopped working for the ten day period. Could be something at google's end?

Thanks to Eric Leichtenschlag and ianhanniballake for trying to help :)

Upvotes: 1

Eric Leichtenschlag
Eric Leichtenschlag

Reputation: 8931

I just downloaded your app and got an ad back. You must have turned back on those categories you previously blocked.

I strongly believe this is related to your change to block a category of ads. This error basically means No Fill.

The server is currently sending back this config with "com.google.DummyAdapter" when there is a no-fill for AdMob, and you have no other networks in your mediation chain. It's still a mystery to me why the SDK can't parse that config, but when that's working as intended, you'll just see a "Failed to load ad: 3" logging statement.

Upvotes: 1

Related Questions