From 3d9b25391e28a3fbd3ff7bbf27cde4da0a4697a6 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 23 Feb 2026 01:24:38 -0800 Subject: [PATCH] fix: enable core library desugaring for flutter_local_notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flutter_local_notifications 插件依赖 java.time API,需要启用 Android core library desugaring 才能在低版本设备上运行。 Co-Authored-By: Claude Opus 4.6 --- it0_app/android/app/build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/it0_app/android/app/build.gradle.kts b/it0_app/android/app/build.gradle.kts index 952172d..0c8e043 100644 --- a/it0_app/android/app/build.gradle.kts +++ b/it0_app/android/app/build.gradle.kts @@ -11,6 +11,7 @@ android { ndkVersion = flutter.ndkVersion compileOptions { + isCoreLibraryDesugaringEnabled = true sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } @@ -39,6 +40,10 @@ android { } } +dependencies { + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") +} + flutter { source = "../.." }