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 @@ + + + + + + + + + + +