Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 618
Julia Avatar asked Sep 11 '25 23:09

Julia


1 Answers

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.

like image 103
Christian Findlay Avatar answered Sep 13 '25 15:09

Christian Findlay