老项目重启,加入了一大堆新代码之后报错了DexArchiveMergerException: Error while merging dex archives

解决方法:

1、app的build.gradle中的dependencies加入

implementation 'com.android.support:multidex:1.0.3'

 

2、App.java继承MultiDexApplication

 

3、app的build.gradle文件中的android->defaultConfig中加入

multiDexEnabled true

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐