This is what we see from Mopub and other ad networks:
java.io.IOException: Connection failure com.google.android.gms.ads.identifier.AdvertisingIdClient.g(Unknown Source) com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
They all seem to have the same problem.
The weird thing is that we have no problem getting the advertising id from our app whatsoever with the following source. We get the right advertising id and we have no error logs. All the SDKs are hitting the same issue (Connection failure).
Any help appreciated.
private void getAdvertisingId(AdvertisingIdHolder receiver) {
AdvertisingIdClient.Info adInfo = null;
String id = null;
boolean isLAT = false;
try {
adInfo = AdvertisingIdClient.getAdvertisingIdInfo(App.getCtx());
id = adInfo.getId();
isLAT = adInfo.isLimitAdTrackingEnabled();
} catch (IOException e) {
SLog.e("error", e);
// Unrecoverable error connecting to Google Play services (e.g.,
// the old version of the service doesn't support getting AdvertisingId).
} catch (GooglePlayServicesNotAvailableException e) {
SLog.e("error", e);
// Google Play services is not available entirely.
} catch (GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
receiver.receive(id, isLAT);
}