Enable core library desugaring for flutter_local_notifications (Java 8+ API on API < 26) #183

Closed
opened 2026-05-23 15:07:25 +00:00 by guettlibot · 1 comment
guettlibot commented 2026-05-23 15:07:25 +00:00 (Migrated from codeberg.org)

Problem

flutter_local_notifications (and potentially other plugins) use Java 8+ APIs that are not natively available on Android API < 26. Without core library desugaring enabled, these calls would crash on older devices.

Fix

Add to android/app/build.gradle.kts:

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")

and enable the isCoreLibraryDesugaringEnabled = true flag in compileOptions.

Reference branch: fix/android-core-library-desugaring

## Problem `flutter_local_notifications` (and potentially other plugins) use Java 8+ APIs that are not natively available on Android API < 26. Without core library desugaring enabled, these calls would crash on older devices. ## Fix Add to `android/app/build.gradle.kts`: ```kotlin coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") ``` and enable the `isCoreLibraryDesugaringEnabled = true` flag in `compileOptions`. Reference branch: `fix/android-core-library-desugaring`
guettlibot commented 2026-05-24 10:55:42 +00:00 (Migrated from codeberg.org)

The fix for this issue (enabling core library desugaring for flutter_local_notifications) is already present in main via commit 1d93eb1 (fix: enable core library desugaring for flutter_local_notifications #37). PR #191 (branch issue-183-fix) has accumulated 12 conflicting CI-related commits that cannot be cleanly rebased onto main. The core fix is a no-op (already applied). Please review whether this issue can be closed.

The fix for this issue (enabling core library desugaring for flutter_local_notifications) is already present in main via commit `1d93eb1` (fix: enable core library desugaring for flutter_local_notifications #37). PR #191 (branch issue-183-fix) has accumulated 12 conflicting CI-related commits that cannot be cleanly rebased onto main. The core fix is a no-op (already applied). Please review whether this issue can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#183