How can I debug java.time classes in an Android app with desugaring enabled?

82 Views Asked by At

In the app that I develop we use ZonedDateTime and some other classes from java.time package very often. And from time to time there is a need for debugging.

I am facing such problems as:

  • methodNotFound exception when I try to invoke a getter for a val field in a data class with ZonedDateTime type
  • cannot cast j$.time to java.time exception when I try to access this field by backing field

I tried to use com.android.tools:desugar_jdk_libs:2.0.0

But it seems to me this problem is a problem of the debugger mostly. Because it doesn't know that j$.time is the same as java.time

1

There are 1 best solutions below

0
On

if you are going to publish your app in Google Play Store, Desugaring library throws some warnings because of usage of Non SDK interfaces: Take a look here: Desugaring warnings