@@ -237,15 +237,10 @@ class FlutterPlugin implements Plugin<Project> {
237237 flutterExecutable = Paths . get(flutterRoot. absolutePath, " bin" , flutterExecutableName). toFile();
238238
239239 if (project. hasProperty(" multidex-enabled" ) &&
240- project. property(" multidex-enabled" ). toBoolean() &&
241- project. android. defaultConfig. minSdkVersion <= 20 ) {
240+ project. property(" multidex-enabled" ). toBoolean()) {
242241 String flutterMultidexKeepfile = Paths . get(flutterRoot. absolutePath, " packages" , " flutter_tools" ,
243242 " gradle" , " flutter_multidex_keepfile.txt" )
244243 project. android {
245- defaultConfig {
246- multiDexEnabled true
247- manifestPlaceholders. applicationName = " io.flutter.app.FlutterMultiDexApplication"
248- }
249244 buildTypes {
250245 release {
251246 multiDexKeepFile project. file(flutterMultidexKeepfile)
@@ -255,18 +250,9 @@ class FlutterPlugin implements Plugin<Project> {
255250 project. dependencies {
256251 implementation " androidx.multidex:multidex:2.0.1"
257252 }
258- } else {
259- String baseApplicationName = " android.app.Application"
260- if (project. hasProperty(" base-application-name" )) {
261- baseApplicationName = project. property(" base-application-name" )
262- }
263- project. android {
264- defaultConfig {
265- // Setting to android.app.Application is the same as omitting the attribute.
266- manifestPlaceholders. applicationName = baseApplicationName
267- }
268- }
269253 }
254+ // Use Kotlin DSL to handle baseApplicationName logic due to Groovy dynamic dispatch bug.
255+ project. apply from : Paths . get(flutterRoot. absolutePath, " packages" , " flutter_tools" , " gradle" , " flutter.gradle.kts" )
270256
271257 String flutterProguardRules = Paths . get(flutterRoot. absolutePath, " packages" , " flutter_tools" ,
272258 " gradle" , " flutter_proguard_rules.pro" )
0 commit comments