@@ -237,15 +237,10 @@ class FlutterPlugin implements Plugin<Project> {
237
237
flutterExecutable = Paths . get(flutterRoot. absolutePath, " bin" , flutterExecutableName). toFile();
238
238
239
239
if (project. hasProperty(" multidex-enabled" ) &&
240
- project. property(" multidex-enabled" ). toBoolean() &&
241
- project. android. defaultConfig. minSdkVersion <= 20 ) {
240
+ project. property(" multidex-enabled" ). toBoolean()) {
242
241
String flutterMultidexKeepfile = Paths . get(flutterRoot. absolutePath, " packages" , " flutter_tools" ,
243
242
" gradle" , " flutter_multidex_keepfile.txt" )
244
243
project. android {
245
- defaultConfig {
246
- multiDexEnabled true
247
- manifestPlaceholders. applicationName = " io.flutter.app.FlutterMultiDexApplication"
248
- }
249
244
buildTypes {
250
245
release {
251
246
multiDexKeepFile project. file(flutterMultidexKeepfile)
@@ -255,18 +250,9 @@ class FlutterPlugin implements Plugin<Project> {
255
250
project. dependencies {
256
251
implementation " androidx.multidex:multidex:2.0.1"
257
252
}
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
- }
269
253
}
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" )
270
256
271
257
String flutterProguardRules = Paths . get(flutterRoot. absolutePath, " packages" , " flutter_tools" ,
272
258
" gradle" , " flutter_proguard_rules.pro" )
0 commit comments