Closed tapeo closed 6 years ago
I'm too facing the same problem.
Is there any update on this issue? Today I'm going to remove this library since it hangs the UI sometimes while fetching current time.
@tapeo + @mohitrajput987 - hmm this does look familiar, I've had a branch for some time where I've been experimenting with some ideas. Can you folks try this branch and tell me if it helps with the issue? https://github.com/instacart/truetime-android/tree/kg/fix/sync_to_atomic
for context on the Instacart app i've been trying 0aef96c
which you can pull from jitpack directly (Note: we use the Rx version which handles a lot of these better).
master should have this fix. for those eager to take this for a spin try
implementation com.github.instacart.truetime-android:library-extension-rx:09087b6a6e
That should point to the latest commit on master
@kaushikgopal That fixed the ANR I was getting.
I know for me the problem was that the initialize method never finishing on my emulator. When I called TrueTime.now()
it would block waiting for the initialize to finish because it calls wasInitialized()
on SntpClient which is synchronized.
👍 thanks for the info @simon-the-canadian. Yeah I don't know what the deal is with emulators. Something has changed recently where it appears like UDP calls don't seem to be going through (this is my guess).
I can raise an issue for this if you think it's something that needs to be addressed, but honestly may not look into it just yet, cause I've basically stopped relying on emulators after they've melted my work machines ><.
Hi! These days, using the
TrueTime.now()
function, there was a problem concerning the locking of the UI without an actual crash. In fact Android showed the ANR message and the application did not respond to the touch. I initialized truetime with the following function:and I run the
TrueTime.now().getTime()
method every 7 seconds. This is the stacktrace. Any information about it? Thank you!