Android – Date in API Level 21 [closed]

Add this to your build.gradle file:

android {
  compileOptions {
    coreLibraryDesugaringEnabled true
  }
}

Newer versions of the Android Gradle plugin (starting with 4.0) are able to use desugaring to backport new APIs to older versions of Android. You can read more about it here: https://jakewharton.com/d8-library-desugaring/

Note that you’ll have to use the Beta release of Android Studio to access these features: https://developer.android.com/studio/preview

Leave a Comment