Skip to content

Conversation

gmazzotta-bit
Copy link

The java.time package is only available natively on Android API 28+. Using it forces consuming apps to enable coreLibraryDesugaring to support older API levels.

This library currently uses java.time.Instant only to log the current date, which can be done easily using the old java.util.Date.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The `java.time` package is only available natively on Android API 28+.
Using it forces consuming apps to enable `coreLibraryDesugaring` to
support older API levels.

This library currently uses `java.time.Instant` only to log the current
date, which can be done easily using the old `java.util.Date`.

Do note that the exact output of `Instant.toString()` depends on the
JDK version, so the resulting string is not necessarily the same, but
the current one should be OK for logging purposes.
@gmazzotta-bit
Copy link
Author

This is currently impacting aws-iot-device-sdk-java-v2, which requires coreLibraryDesugaring despite not using anything from java.time directly.

I'm all for using java.time when dealing with dates, but adding an extra dependency just to log a timestamp seems a bit overkill to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant