Fix Issue : Execution failed for task ':app:mergeDexDebug' (Error while merging dex archives)

D8: Cannot fit requested classes in a single dex file (# methods: 82682 > 65536) Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.

If you are working on a flutter application and if you get these types of error.

Execution failed for task ':app:mergeDexDebug'.

A failure occurred while executing$ActionFacade Error while merging dex archives:

Solution of these issues:

Enable multidex for apps with over 64K methods

Step 1: Open File in your project your_project>Android>app/build.gradle

Step 2: Modify the module-level build.gradle file to enable multidex and add the multidex library as a dependency, as shown here:

android {
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 28
        multiDexEnabled true

dependencies {
  implementation ''

Why showing this issue in Application

When you are working with compileSdkVersion above 21 then need to add implementation '' a dependency. After your app gets started.

Next Post »