Skip to content

Instantly share code, notes, and snippets.

@yenerm
Last active June 16, 2020 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yenerm/a8628729d88cc633a11cceeffd583367 to your computer and use it in GitHub Desktop.
Save yenerm/a8628729d88cc633a11cceeffd583367 to your computer and use it in GitHub Desktop.
Java 8 desugaring
<!-- Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0 -->
android {
defaultConfig {
//Only required when setting minSdkVersion to 20 or lower
multiDexEnabled true
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
// Dependency with the implementation code for the APIs
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.5'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment