com.android.builder.dexing.dexarchivemergerexception error while merging dex archives flutter
1) Open {your flutter project}/android/app/build.gradle and add following lines.
defaultConfig {
...
multiDexEnabled true // Add this line
}
dependencies {
...
implementation 'com.android.support:multidex:1.0.3' // Add this line
}
2) Migrate to AndroidX.
Open {your flutter project}/android/gradle.properties and add following lines.
...
android.useAndroidX=true // Add this line
android.enableJetifier=true //Add this line