From 18c784692f596419105b8de7dc34ef663f57c7a1 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 18 Oct 2020 10:31:34 +0300 Subject: [PATCH] Enable desugaring (needed by ical4android). ical4j and thus ical4android now rely on java.time.ZoneOffset which is only available in Android starting from Android 8. This will make it work on older Android versions too. --- app/build.gradle | 5 +++++ app/proguard-rules.txt | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cbfa2897..de50a1cb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -122,6 +122,9 @@ android { buildTypes.release.signingConfig = null } compileOptions { + // enable because ical4android requires desugaring + coreLibraryDesugaringEnabled true + sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -135,6 +138,8 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.5' + implementation "org.jetbrains.anko:anko-commons:0.10.4" implementation "com.etesync:journalmanager:1.1.1" diff --git a/app/proguard-rules.txt b/app/proguard-rules.txt index b981122e..345ebb71 100644 --- a/app/proguard-rules.txt +++ b/app/proguard-rules.txt @@ -10,7 +10,6 @@ -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* -optimizationpasses 5 -allowaccessmodification --dontpreverify # Kotlin -dontwarn kotlin.** @@ -25,14 +24,7 @@ -keep class ezvcard.property.** { *; } # keep all vCard properties (created at runtime) # ical4j: ignore unused dynamic libraries --dontwarn aQute.** --dontwarn groovy.** # Groovy-based ContentBuilder not used --dontwarn javax.cache.** # no JCache support in Android --dontwarn net.fortuna.ical4j.model.** --dontwarn org.codehaus.groovy.** --dontwarn org.apache.log4j.** # ignore warnings from log4j dependency -keep class net.fortuna.ical4j.** { *; } # keep all model classes (properties/factories, created at runtime) --keep class org.threeten.bp.** { *; } # keep ThreeTen (for time zone processing) # okhttp # JSR 305 annotations are for embedding nullability information.