13

I'm getting the following error when trying to submit my app to the Play Store:

Your declaration on Play Console says that your app uses advertising ID. Your manifest file doesn't include the com.google.android.gms.permission.AD_ID permission.

I've already declared the AD_ID permission in my AndroidManifest.xml file, as follows:

 <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

My app's targetSdk version is 33 and the AdMob ads library version that I have included is 21.3.0, as follows:

  implementation 'com.google.android.gms:play-services-ads:21.3.0'

I've follow every step in the AdMob Get Started guide and it doesn't work.

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
Julia
  • 1,207
  • 4
  • 29
  • 47

4 Answers4

12

I had this problem and I solved it. The issue is that one of your dependencies (possibly Firebase) is forcefully inserting this permission into the manifest during the build process. I.e. after you manually craft the file. You can add a directive to the manifest to remove the permission at the end of the process and then you won't have the problem when uploading it to the store.

You need to add this to your manifest but outside the application

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>

But, you also need to add the tools XML namespace or the build will fail. this goes inside the root manifest node

xmlns:tools="http://schemas.android.com/tools"

You can also check the manifest before you upload to the Google Play store. Just rename the apk/appbundle to .zip , unzip the file and check the contents of the manifest file.

Christian Findlay
  • 6,770
  • 5
  • 51
  • 103
  • This answer isn't clear where to put tools, here is explanation https://stackoverflow.com/questions/55334431/facing-below-error-toolsnode-associated-with-an-element-type-uses-permission – Guy Luz Jun 21 '23 at 15:45
  • first you need to add " xmlns:tools="http://schemas.android.com/tools" on top of manifest tag, then you need to add permission. it will help you to resolve the issue. – Mirza Hayat Jul 04 '23 at 10:31
6

Firebase Analytics is using the com.google.android.gms.permission.AD_ID permission to track users.(https://support.google.com/analytics/answer/11593727?hl=en)

You can remove that permission adding to your manifest

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />

But this will probably invalidate your usage statistics

P1x
  • 1,690
  • 1
  • 19
  • 24
2

For apps uploaded which targets android 13 you have to:

  1. (Skip to 2 if you don't use advertising) Add the permission <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> in your manifest if your app uses ads.
  2. In your Play Console scroll down to and click on App Content at the bottom on the left side menu. In the opened page you have to complete the Advertising ID section which pretty much is for declaring that you use and Advertising ID or not.

The problem we faced was that we don't use any advertising in our app but the Firebase Core library needs the Advertising library. So in gradle we're removing that library from our build like this:

gmsImplementation ('com.google.firebase:firebase-core') {
    exclude group: 'com.google.android.gms', module: 'play-services-ads-identifier'
}
just_user
  • 11,769
  • 19
  • 90
  • 135
1

I'm also having this issue. No fix yet.

EDIT:

Seems others are having issues with this as well.

Reading this reddit thread, a user mentioned that the issue is on the Play Console Team's side and everyone is facing it.

They've also published their app to production and everything is fine, so the error warning can be ignored.

Kalvin2044
  • 11
  • 2