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.