From 1c8acdaf02f3425e12b73d9899eda3dd04cd0e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E8=B4=A4?= Date: Fri, 26 Dec 2025 15:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=AE=89=E5=8D=93ota?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=9F=BA=E7=A1=80=E5=BB=BA=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 10 ++++++++ android/app/src/main/AndroidManifest.xml | 17 ++++++++++++++ .../main/res/xml/network_security_config.xml | 3 +++ .../main/res/xml/ota_update_file_paths.xml | 4 ++++ lib/main.dart | 23 +++++++++++++++++++ pubspec.yaml | 1 + 6 files changed, 58 insertions(+) create mode 100644 android/app/src/main/res/xml/ota_update_file_paths.xml diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 43f412a..fc6043d 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -13,6 +13,7 @@ android { ndkVersion = "27.0.12077973" compileOptions { + isCoreLibraryDesugaringEnabled = true sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } @@ -22,6 +23,7 @@ android { } defaultConfig { + multiDexEnabled = true // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.juxinghe.touchme" // You can update the following values to match your application needs. @@ -104,3 +106,11 @@ android { flutter { source = "../.." } + +dependencies { + // 注意:KTS 写法是 coreLibraryDesugaring(...) + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") + + // 如果你 minSdk <= 20 并开启了 multiDexEnabled,还需要: + // implementation("androidx.multidex:multidex:2.0.1") +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 887db0a..b1c9205 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,8 @@ + + + + + + + + + + +