的廣告信息這是我們從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);
}