Skip to main content

65K reference limit

Unity: All versions | Appodeal SDK: All versions

The error "Cannot fit requested classes in a single dex file" happens if the number of method references exceed the 65K reference limit.

The error example from Unity Editor Log:

D8: Cannot fit requested classes in a single dex file (# methods: 136481 > 65536)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:transformDexArchiveWithExternalLibsDexMergerForRelease'.
> Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at

To solve the error enable Multidex support.

Go to File → Build settings → Player Settings → Player → Minimum API level and set up minimum API level to 21 or higher, where Multidex is enabled by default.