的广告信息这是我们从Mopub和其他广告网络看到:广告SDK似乎无法获取设备
产生java.io.IOException:连接失败 com.google.android。 gms.ads.identifier.AdvertisingIdClient.g(未知 来源) com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(未知 来源)
他们都似乎有同样的问题。
奇怪的是,我们没有任何问题从我们的应用获取广告ID与以下来源。我们得到正确的广告ID,并且我们没有错误日志。 所有的SDK都遇到同样的问题(连接失败)。
任何帮助表示赞赏。
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);
}