Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix too many calendars on Android #2503

Merged
merged 6 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading