Skip to content

Commit

Permalink
Added desugaring to prevent crashes on api < 26 as kotlinx.datetime i…
Browse files Browse the repository at this point in the history
…s using Java.Instant under the hood.
  • Loading branch information
HeyPouya committed Sep 21, 2024
1 parent 1e46f9c commit 385efe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ android {
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Expand All @@ -47,6 +48,9 @@ dependencies {
implementation(projects.core)
implementation(projects.features.calendarDetails)
implementation(libs.androidx.core)

// Datetime
coreLibraryDesugaring(libs.desugar.jdk.libs)
implementation(libs.kotlinx.datetime)

// Support
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
appVersion = "614"
compileSdkVersion = "34"
desugar_jdk_libs = "2.1.2"
glance = "1.1.0"
javaxInject = "1"
kotlinxDatetime = "0.6.1"
Expand Down Expand Up @@ -36,6 +37,7 @@ crashlyticsVersion = "3.0.2"
[libraries]
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
constraintLayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintLayout" }
desugar_jdk_libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar_jdk_libs" }
javax-inject = { module = "javax.inject:javax.inject", version.ref = "javaxInject" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime" }
recyclerView = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerView" }
Expand Down

0 comments on commit 385efe2

Please sign in to comment.