diff --git a/.changes/2503-fix-calendar-on-android.md b/.changes/2503-fix-calendar-on-android.md new file mode 100644 index 000000000000..804ebc9d35c4 --- /dev/null +++ b/.changes/2503-fix-calendar-on-android.md @@ -0,0 +1 @@ +- Fix App generating too many device calendars on some devices \ No newline at end of file diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index 0465d732ab23..370b58bd639f 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -64,6 +64,10 @@ android { buildTypes { release { signingConfig signingConfigs.release + + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } } namespace 'global.acter.app' diff --git a/app/android/app/proguard-rules.pro b/app/android/app/proguard-rules.pro new file mode 100644 index 000000000000..89f666a5591f --- /dev/null +++ b/app/android/app/proguard-rules.pro @@ -0,0 +1,24 @@ +# Flutter Wrapper +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.plugins.** { *; } + +# FIX for: ERROR: R8: Library class android.content.res.XmlResourceParser implements program class org.xmlpull.v1.XmlPullParser +-dontwarn org.xmlpull.v1.** +-dontwarn org.kxml2.io.** +-dontwarn android.content.res.** +-dontwarn org.slf4j.impl.StaticLoggerBinder +-keep class org.xmlpull.** { *; } +-keepclassmembers class org.xmlpull.** { *; } + +# -keep class io.flutter.app.** { *; } +# -keep class io.flutter.** { *; } +# --- /end fix + +# ---- Specific plugins: +# Firebase for notifications +-keep class com.google.firebase.** { *; } +# Device Calendar fix +# see https://github.com/builttoroam/device_calendar/issues/99 +-keep class com.builttoroam.devicecalendar.** { *; } \ No newline at end of file diff --git a/app/android/gradle.properties b/app/android/gradle.properties index a79a25885781..b623eb8d0afd 100644 --- a/app/android/gradle.properties +++ b/app/android/gradle.properties @@ -3,4 +3,5 @@ android.enableJetifier=true org.gradle.jvmargs= -Xmx8g -Xms512M -XX:ReservedCodeCacheSize=2048m -XX:+UseCompressedOops -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=false +android.enableR8=true \ No newline at end of file diff --git a/app/lib/features/calendar_sync/calendar_sync.dart b/app/lib/features/calendar_sync/calendar_sync.dart index 8f3c844d6a8a..4ff6a2370683 100644 --- a/app/lib/features/calendar_sync/calendar_sync.dart +++ b/app/lib/features/calendar_sync/calendar_sync.dart @@ -162,7 +162,7 @@ Future _refreshCalendar( final currentLinkKeys = currentLinks.values; List foundEvents = []; if (currentLinkKeys.isNotEmpty) { - _log.info('Current links: $calendarId: ${currentLinkKeys.length}'); + _log.info('Current links: $calendarId: $currentLinkKeys'); final foundEventsResult = await deviceCalendar.retrieveEvents( calendarId, RetrieveEventsParams(eventIds: currentLinks.values.toList()),