2

I'm working with Android studio and use Jack to enable Java8 features, but it seems that LocalDateTime is still not implemented, is that the case?

this question asks the same question, but it's dated since now Android supports Java8 with the Jack.

Community
  • 1
  • 1
Salah Alshaal
  • 860
  • 2
  • 17
  • 41
  • 2
    Possible duplicate of [cannot resolve symbol 'java.time.LocalDate' error in android studio](http://stackoverflow.com/questions/28745205/cannot-resolve-symbol-java-time-localdate-error-in-android-studio) – Yury Fedorov Jul 12 '16 at 05:58

2 Answers2

4

I don't know Jack, but it appears to not include an implementation of the java.time package built into Java 8 and later.

java.time back-port

Fortunately, much of the java.time functionality is back-ported to Java 6 & 7 in the ThreeTen-Backport project, and further adapted to Android in the ThreeTenABP project.

See: How to use ThreeTenABP in Android project

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
1

Try Using Joda-Time, it inspired the java.time package in Java 8

http://www.joda.org/joda-time/

And for your issue, check below

https://developer.android.com/preview/j8-jack.html#supported-features

johnrao07
  • 6,690
  • 4
  • 32
  • 55
  • 2
    Actually, the Joda-Time team advises migration to java.time. The ThreeTenABP project is an adaption of java.time for Android. – Basil Bourque Jul 12 '16 at 06:12