Countly not using supplied device id


#1

I see in the documentation that if we do not provide a device id when initializing Countly, then Countly will fall back to using a Google Advertising Id and then if that is not available, OpenUDID. When I initialize Countly with my own device id, it is still attempting to obtain an advertising id from Google.

We have a use case where we do not have an internet connection and thus when the retrieving of the advertising id occurs and fails, subsequent connections in my app do not work. How can I get it to stop trying to obtain an advertising id from Google?

I am using Countly in a Xamarin.Forms project and I am seeing this behavior using the Xamarin.Android SDK.

This is the code that I am using as well as the error I see in the console:

Countly.SharedInstance()
            .Init(this, CountlyWrapper.Url, CountlyWrapper.ApiKey,
                Secure.GetString(ApplicationContext.ContentResolver, Secure.AndroidId),
                DeviceId.Type.DeveloperSupplied)
            .SetViewTracking(true)
            .EnableCrashReporting();

Couldn't get advertising ID, while caching

07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): java.lang.reflect.InvocationTargetException
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at java.lang.reflect.Method.invoke(Native Method)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at ly.count.android.sdk.AdvertisingIdAdapter.getAdvertisingId(AdvertisingIdAdapter.java:53)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at ly.count.android.sdk.AdvertisingIdAdapter.access$000(AdvertisingIdAdapter.java:8)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at ly.count.android.sdk.AdvertisingIdAdapter$2.run(AdvertisingIdAdapter.java:93)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at java.lang.Thread.run(Thread.java:761)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): Caused by: java.io.IOException: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at com.google.android.gms.ads.identifier.AdvertisingIdClient.start(Unknown Source)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): ... 5 more
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): Caused by: java.util.concurrent.TimeoutException: Timed out waiting for the service connection
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): at com.google.android.gms.common.zza.zza(Unknown Source)
07-17 19:23:50.257 E/AdvertisingIdAdapter(14891): ... 8 more


#2

Thanks. Lets check this and get back.


#3

Any word on this? On version 1.1.1 of the Android Countly Sdk and this problem still occurs. This can be reproduced by putting turning wifi and cellular off in an emulator.


#4

Lets check this. @arturs_k any information on this issue? Not sure if it is related to Xamarin SDK or Android SDK directly, but if it is about Xamarin, just let me know.


#5

Ok. To be clear, I just have a hard coded '1' in there as an id and pass the DeviceId.Type.DeveloperSupplied flag so I am not sure why it would even be trying to get an advertising ID at that point.

Capture


#6

Any word back on this yet?


#7

Hi @jplusm. Arturs is away for a while, so he'll get back to you later. Looking at Android SDK it seems to be a bug related to the way SDK handles limited ad tracking. Yet it seems to be a harmful bug, it doesn't seem to be crashing anything, right?


#8

Nope, app isn't crashing. Just getting the stack trace. I would of thought if I passed my own device id that it would just use that and not try to go out and get anything else though.


#9

Sorry, I meant harmless of course. I'm sure @arturs_k will fix it in coming release since it's not exactly an emergency situation.

Thanks for noting by the way!