Software⏱️ 1 min read📅 2026-05-30

How to Fix: Error:Cannot fit requested classes in a single dex file.Try supplying a main-dex list. # methods: 72477 > 65536

Android Studio error: Cannot fit requested classes in a single dex file. Try supplying a main-dex list.

Quick Answer: Add the 'mainDexList' property to your build.gradle file and specify the path to your main Dex file.

To resolve the 'Error: Cannot fit requested classes in a single dex file.Try supplying a main-dex list.' issue, you need to add the `mainDexList` property to your `defaultConfig` block in your `build.gradle` file.

🔧 Proven Troubleshooting Steps

Method 1: Enable ProGuard

  1. Step 1: In your `build.gradle` file, add the following line to the `defaultConfig` block:

Method 2: Add Main Dex List

  1. Step 1: In your `build.gradle` file, add the following line to the `defaultConfig` block:

By adding either of these methods, you should be able to resolve the error and successfully build your project.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions