Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude hidden Google AdMob ads dependency from Android app

Recently Google began to mark Google Play apps that contain ads with a special sign. I'm asked to set a flag in the developers console, if my app has ads or not. However, when I set it to NO - a hint is displayed, that an active APK has AdMob SDK linked, so the app is suspected to be advertisement capable. No AdMob SDK is present in the gradle dependencies, just Google Analytics and Maps.

I guess, Google Analytics SDK depends on AdMob somehow. Is there a way to exclude hidden AdMob dependencies from my app?

Update:

gradle settings looks like this:

compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-maps:8.1.0'
like image 335
Vladimir Afinello Avatar asked Nov 19 '15 15:11

Vladimir Afinello


People also ask

Why do I see an app that isn't mine in my AdMob account?

Why do I see an app that isn't mine in my AdMob account? This is a sign that app-ads. txt is working correctly to protect you against ad fraud. Keep in mind, ad sources that have adopted app-ads.

How do I get rid of Play services ads identifier?

Now, You have a list of dependacy who contains "play-services-ads-identifier", so add { exclude module: "play-services-ads-identifier" } in each dependacy to remove. 3. After following steps 2, You need to execute steps 1 again to verify that, Once you found that "play-services-ads-identifier" is removed.


2 Answers

This dependecy is placed in com.google.android.gms:play-services-analytics
So you shuld exclude play-services-ads mudule from analytics' dependency in your build.gradle file this way:

compile ('com.google.android.gms:play-services-analytics:8.1.0') {
    exclude group: 'com.google.android.gms', module: 'play-services-ads'
}
like image 95
smbd uknow Avatar answered Oct 22 '22 14:10

smbd uknow


Google Play Services includes an API for Google Mobile Ads. You may have included the entire Google Play Services API instead of only including the Maps and Analytics APIs, which are the ones you need.

Check to see that you have this in your gradle:

compile 'com.google.android.gms:play-services-maps:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'

Instead of this:

compile 'com.google.android.gms:play-services:8.3.0'
like image 28
NoChinDeluxe Avatar answered Oct 22 '22 14:10

NoChinDeluxe