Case 1: The app doesn’t contain any Ads:
You can simply remove/ignore it by adding tools:node="remove"
in the AndroidManifest.xml
file.
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
Make sure you have xmlns:tools
at the top of AndroidManifest.xml
file
Even if another third-party library asks for this specific permission, the build will be forced not to merge it in your final Manifest file.
You can get more info from this SO answer.
Case 2: The app contains Ads:
Add the following to AndroidManifest.xml
before </manifest>
:
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
You can get more information from here.