无法合并 dex 错误 [英] Unable to merge dex error

查看:25
本文介绍了无法合并 dex 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的应用 build.gradle 文件

This is my app build.gradle file

它在 appcompat 依赖文件中显示错误.我尝试了清理项目和构建项目以及很多方法,但仍然显示错误.这是我运行项目时的错误.

It shows error in the appcompat dependecy file. I tried clean project and build project and so many ways but still the error shows. This is my error when i run project.

**错误:任务:app:transformDexArchiveWithExternalLibsDexMergerForDebug"的执行失败.

**Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: 无法合并 dex**

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex**

推荐答案

将此添加到您的 app.gradle 文件

Add this to your app.gradle file

 android {
          defaultConfig {
            multiDexEnabled true
            }
       }

也添加依赖

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

它会解决你的问题

这篇关于无法合并 dex 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆