Reputation: 11
Getting the Google Advertising ID on Android requires to import the play-services-ads
dependency.
Starting from 17.0.0, this dependency enforces that the application manifest contain a <meta-data>
tag with key com.google.android.gms.ads.APPLICATION_ID
. Missing tag leads to an application crash.
But I want to retrieve the Google Advertising ID for ads purposes that are not related to Google mobile Ads, and I do not have an application ID.
Does anyone know how to proceed now ?
Upvotes: 1
Views: 654
Reputation: 31
You can use play-services-ads-identifier instead of play-services-ads.
implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
This will import only the Advertising ID classes, without Google Mobile Ads/AdMob.
Upvotes: 3