Skip to content

Commit

Permalink
Merge pull request #2503 from acterglobal/ben-fix-calendars-on-android
Browse files Browse the repository at this point in the history
Fix too many calendars on Android
  • Loading branch information
gnunicorn authored Jan 19, 2025
2 parents 675de01 + cb561f7 commit a5ab624
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changes/2503-fix-calendar-on-android.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix App generating too many device calendars on some devices
4 changes: 4 additions & 0 deletions app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release

minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}
}
namespace 'global.acter.app'
Expand Down
24 changes: 24 additions & 0 deletions app/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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.** { *; }
3 changes: 2 additions & 1 deletion app/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
android.nonFinalResIds=false
android.enableR8=true
2 changes: 1 addition & 1 deletion app/lib/features/calendar_sync/calendar_sync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Future<void> _refreshCalendar(
final currentLinkKeys = currentLinks.values;
List<Event> 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()),
Expand Down

0 comments on commit a5ab624

Please sign in to comment.