om.android.build.api.transform.TransformException: Error while generating the main dex list. * Try:

1. 错误描述

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list.

* 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

2. 错误原因

设置了MultiDex,但是没有初始化

3. 解决方案

在自定义的Application的onCreate()中进行初始化;

你可能感兴趣的:(om.android.build.api.transform.TransformException: Error while generating the main dex list. * Try:)