D8: Cannot fit requested classes in a single dex file

(Madhav Kothari) #1

After running my project it shows an error -

"
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\4.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\5.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\6.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\7.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\13.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\18.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\23.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\28.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\33.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\38.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\39.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\40.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\41.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\42.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\48.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\49.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\50.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\51.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\52.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\54.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\55.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\56.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\57.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\59.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\60.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\61.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\62.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\68.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\69.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\70.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\71.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\72.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\78.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\83.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\84.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\85.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\86.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\87.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\89.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\90.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\91.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\92.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\98.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\103.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\108.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\113.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\118.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\123.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\128.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\133.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\138.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\143.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\148.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\153.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\154.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\155.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\156.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\157.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\163.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\168.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\173.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\178.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\183.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\188.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\193.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\198.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\203.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\208.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\213.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\218.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\223.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\228.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\233.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\238.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\243.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\248.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\253.jar, D:\AndroidStudio\pg_dekhlo\build\app\intermediates\transforms\dexBuilder\debug\258.jar
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
"

0 Likes

(uklance) #2

There’s a link in the error message

https://developer.android.com/studio/build/multidex

This is an issue in the android gradle plugin and is not a core gradle issue. I suggest you ask your question on the android forums

0 Likes