41

Google has put a new option on their Pricing and Distribution page of their Google Play Developer Console that requires publishers to declare if they have ads or not. Our app does not have ads, yet we are being flagged as having the AdMob SDK.

We detected Ad SDKs in one or more of your active APKs:

version: XXXXX, sdk: AdMob

If your app is serving ads, please change your ads declaration to 'Yes'. Failure to accurately declare the presence of ads is a policy violation and may result in your app's removal from Google Play. You can visit our Help Center to learn more.

We don't have AdMob, as far as I can tell from our Gradle file:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'me.dm7.barcodescanner:zxing:1.7.2'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
}

What might be causing that dependency to show up? How can I get rid of it?

1

4 Answers 4

48

You can run gradlew -q dependencies app:dependencies to see a the dependencies (including all transitive dependencies) for each of your configurations.

You can also specify a single configuration, such as with --configuration releaseCompile

In your case, you will find that Google Play Services includes a transitive dependency on AdMob.

You can mitigate this by using only individual components of Play Services (such as play-services-location) instead of the entirety of Play Services. However, you may find that one of the individual components you use still relies on AdMob. For example, version 8.1.0 of play-services-analytics has a transitive dependency on play-services-ads, which is the AdMob SDK.

5
  • It was coming from the com.google.android.gms:play-services:x.x.x dependency. By changing that to just maps com.google.android.gms:play-services-maps:x.x.x I was able to get rid of that AdMob dependency. Thanks! Nov 18, 2015 at 21:44
  • 1
    Note that the play-services-analytics dependency upon play-services-ads seems to be limited to version 8.1.0. Previous and later versions of play-services-analytics no longer have this transitive dependency, unless I am misreading the POMs somehow... Other than that, though, great analysis! Nov 19, 2015 at 13:14
  • @CommonsWare you are correct! I hadn't had a chance to update Google Play Services recently, but doing so removed the transitive dependency. Nov 19, 2015 at 15:54
  • 5
    Ads identifier is also included in firebase analytics: com.google.firebase:firebase-analytics:18.0.0 contains com.google.android.gms:play-services-measurement:18.0.0 which contains com.google.android.gms:play-services-ads-identifier:17.0.0
    – Szamot
    Nov 3, 2020 at 11:02
  • Authentic source from Google claiming this in first stmt firebase.google.com/policies/analytics Dec 23, 2020 at 13:05
24

I have follow below steps and It removes the notification

First check that which gradle package contains "play-services-ads-identifier" package depency. You can add update those packages like below:

implementation('com.google.firebase:firebase-analytics') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}

Second, If you have analytics package in your gradle which contains ads then you have to follow these steps OR you can skip it. You can add below tag in your app's manifest's tag.

<meta-data android:name="google_analytics_adid_collection_enabled"
        android:value="false" />

Hope it will help you as well.

3
  • 1
    I have these two implementation "com.google.firebase:firebase-core:16.0.8" implementation "com.google.firebase:firebase-messaging:17.6.0" sdks being used in my app and I am getting the same issue. Jun 2, 2021 at 8:15
  • 1
    To solve this issues accurately, Here are the steps: 1. Find a list of dependacy which contains "play-services-ads-identifier". You can follow steps from below URL medium.com/android-news/gradle-dependency-tree-819b68898a53 2. 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. You can good to upload app on Play store.
    – JK Patel
    Jun 3, 2021 at 9:20
  • implementation ('com.google.firebase:firebase-analytics') { exclude module: "play-services-ads-identifier" exclude module: "play-services-measurement" exclude module: "play-services-measurement-sdk" } Here is another updates to exclude ads from measurements as well.
    – JK Patel
    Aug 27, 2021 at 9:56
11

From the Google Play Support Chat I was addressed to say "No" in Google Play Console, despite the detection.

4
  • I have also had this detection and I make no use of advertising SDK. I have just selected the no option. Nov 20, 2015 at 7:04
  • Same. I selected the no option and Google Play did not remove my app.
    – Markymark
    Jan 22, 2021 at 17:30
  • Did you have any consequence for doing this? May 18, 2021 at 19:49
  • 2
    This is not a solution, you can say "No" and your app will be deleted, you must be sure of not having dependencies or code related to AdMob.
    – Jorgesys
    Aug 20, 2021 at 23:51
6

I have solved with these steps

  1. First find list of android dependencies which contain play-services-ads-identifier. Through Android Studio Gradle Panel Click on Gradle tab on the right side

Task will print all dependencies including internal packages example included in below image

  1. After that exclude play-services-ads-identifier. in my case I have two dependencies which contain play-services-ads.
  • First dependency:
implementation('com.google.firebase:firebase-core:19.0.2') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}
  • Second dependency:
implementation('com.google.firebase:firebase-analytics') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}

It solved my issues.

3
  • Does it affect firebase analytics as well ? I need to keep analytics but just remove AD_ID permission...
    – EAK TEAM
    Jul 26, 2022 at 21:22
  • I did the same thing and it removed the ads-identifier library. However I am not sure if there are going to be any runtime crashes. Can anybody confirm this? Aug 13, 2022 at 6:27
  • On my side, I had to also remove play-services-measurement-api
    – N3sh
    Aug 15 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.