I am trying to get the google ad id (GAID)in android java but I am getting exeception like:
androidx.ads.identifier.AdvertisingIdNotAvailableException: No compatible AndroidX Advertising ID Provider available.
My Code
ListenableFuture<AdvertisingIdInfo> adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());
System.out.println("adinfo"+adInfo.toString());
try {
String id = adInfo.get().getId();
System.out.println("adod"+id);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
And dependienced i added
implementation 'com.google.android.gms:play-services-ads:19.4.0'
implementation 'androidx.ads:ads-identifier:1.0.0-alpha04'
In Manifest I added
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
I have tried many solutions but it is not useful. Please help me out to solve the issue.
