Changed: Enable desugaring support to enable support for new language APIs like Java 8 on old android versions

https://developer.android.com/studio/write/java8-support
This commit is contained in:
agnostic-apollo
2022-04-26 02:02:26 +05:00
parent 623aaebb4a
commit 9143ebdc22
2 changed files with 8 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ android {
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@@ -140,6 +143,7 @@ android {
dependencies {
testImplementation "junit:junit:4.13.2"
testImplementation "org.robolectric:robolectric:4.4"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
}
task versionName {

View File

@@ -49,6 +49,9 @@ android {
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@@ -63,6 +66,7 @@ dependencies {
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
}
task sourceJar(type: Jar) {