> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
D8: Cannot fit requested classes in a single dex file (# methods: 70644 > 65536

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: 
  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

解决方法:在android/app/build.gradle文件中添加

multiDexEnabled true(写在defaultConfig对象中)

 

posted @ 2019-06-24 22:01  lude1994  阅读(3312)  评论(0)    收藏  举报