Cannot fit requested classes in a single dex file (# methods: 65536 > 65536) — mergeDex failed
The app exceeds the 64K method reference limit of a single DEX file and multidex isn’t enabled (minSdk below 21).
Seen on:
Android
Meaning
Apps with minSdk 21+ get multidex automatically. With lower minSdk you must enable multidex — or better, raise minSdk and shrink dependencies.
Common causes
- minSdk < 21 with many dependencies
- Large libraries pulling many methods
- Multidex not enabled
⚡ Quick fix
- Raise minSdk to 21+ (recommended)
- Or enable multiDexEnabled true and add androidx.multidex
- Remove unused dependencies / enable R8 shrinking
Detailed fix by platform
Gradle
- kotlin
android { defaultConfig { minSdk = 21 // multidex native from API 21 // multiDexEnabled = true // only if minSdk < 21 } }
How to diagnose
- minSdk — Value in build file
- Methods — APK Analyzer reference count
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Android
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026