I'm developing an app using Android Studio 2.1.2, API level 23.
In a class I used the java.time.LocalTime
class, but at runtime an unhanded NoClassDefFoundError
exception kills my activity. Googling, I understood that I have to add dependencies in build.gradle because Android classes are developed using a version of JDK older than Java 8 (when the LocalTime
class has been added).
So I have to write something like: compile "java.time:LocalTime:1.8"
But it doesn't work.
The Android runtime supports a limited subset of the standard library enhancements made in JDK 8. The JDK 8 date time library is not supported. You can use something like http://www.threeten.org/threetenbp/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With