Your manifest file doesn't include the com.google.android.gms.permission.AD_ID permission
Asked Answered
M

7

24

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.

Misuse answered 19/10, 2022 at 15:12 Comment(0)
F
20

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.

Faraway answered 8/2, 2023 at 2:6 Comment(3)
This answer isn't clear where to put tools, here is explanation #55334931Sinfonietta
first you need to add " xmlns:tools="schemas.android.com/tools" on top of manifest tag, <manifest xmlns:android="schemas.android.com/apk/res/android" xmlns:tools="schemas.android.com/tools" ----- add this package="com.mycompany.myapp"> then you need to add permission. <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/> it will help you to resolve the issue.Employer
How does this solve the problem? The question asked was in the context of wanting Ad ID enabled.Pressley
H
7

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

Harmaning answered 7/11, 2022 at 14:48 Comment(2)
This looks like the correct answer but this causes my build to failFaraway
xmlns:tools="schemas.android.com/tools" this helpsStuckey
I
4

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'
}
Irresolution answered 28/10, 2022 at 6:52 Comment(2)
already done that, and still getting this error.Misuse
@Misuse check the version the error is for. It shows up for me on some older versions but not the latest.Irresolution
C
2

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.

Charlatanism answered 12/11, 2022 at 2:4 Comment(1)
Did you check your merged manifest? Is the permission there?Harmaning
J
2

You can use the official documentation and add the following line to your manifest to disable the AD_ID

Firebase - Disable Advertising ID collection

<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
Journalism answered 1/4 at 20:4 Comment(0)
C
1

Firebase documentation suggests to disable the AD_ID permission adding the following to the manifest:

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

An older thread recommends excluding the

play-services-ads-identifier

from all below dependencies:

// Firebase
implementation platform('com.google.firebase:firebase-bom:26.6.0')
implementation ('com.google.firebase:firebase-core') {
    exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
}
implementation ('com.google.firebase:firebase-messaging') {
    exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
}
implementation ('com.google.firebase:firebase-crashlytics') {
    exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
}
implementation ('com.google.firebase:firebase-analytics') {
    exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
}

Another solution as mentioned in earlier answers is to remove the permission node from your manifest:

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

I don't yet know the reproductions of each solution but have the same problem and am going to test them.

Update

The 4th answer to this post maybe the best way to go if you want to collect analytics data and don't change your code You can choose YES to whether your app has AD_ID and then choose Analytics as the reason. I

Cattycornered answered 8/9, 2023 at 8:4 Comment(0)
L
0

In my case, the problem was that I had an older version of my app in the internal testing section, which didn't use the AP_ID. Once I uploaded a new version in the internal testing section with the declaration of the AD_ID, I was then able to upload the app as well.

Least answered 5/7 at 20:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.