Gradle 构建错误将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Landroid/arch/lifecycle/liveData$1 [英] Gradle build error Error converting bytecode to dex:Cause: com.android.dex.DexException:Multiple dex files define Landroid/arch/lifecycle/liveData$1

查看:33
本文介绍了Gradle 构建错误将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Landroid/arch/lifecycle/liveData$1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从过去 3 天开始,我收到此错误并已尽我所能.谁能帮我纠正一下.我正在使用 Android 3.0 并且我的 sdk 和 Google Play 服务已更新,并且我已将 multiDexEnabled true 添加到我的代码中...并且还尝试删除 .gradle 和 .idea 文件夹并再次重建....但错误仍然存​​在任何帮助将不胜感激

From last 3 days I'm getting this error and have tried all i could. Can anyone help me correct it. I'm using Android 3.0 and my sdk and Google play services are updated as well as i have addedmultiDexEnabled true to my code...and also tried deleting the .gradle and .idea folders and again rebuilding the....but the error is still there any help would be appreciated

将字节码转换为 dex 时出错:原因:com.android.dex.DexException: 多个 dex 文件定义landroid/arch/lifecycle/liveData$1;

Error converting bytecode to dex: Cause: com.android.dex.DexException:Multiple dex files define Landroid/arch/lifecycle/liveData$1;

推荐答案

我刚刚遇到了同样的问题,并通过更新生命周期库的版本来修复它:

I've just met the same issue and fixed it by updating the version of lifecycle library:

implementation 'android.arch.lifecycle:runtime:1.1.0'
implementation 'android.arch.lifecycle:extensions:1.1.0'
implementation 'android.arch.lifecycle:compiler:1.1.0'

似乎在我的项目中使用的另一个库声明了 1.1.0 版本,但我使用的是 1.0.0.

It seems that another library using in my project declare the version 1.1.0, but i was using 1.0.0.

这篇关于Gradle 构建错误将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Landroid/arch/lifecycle/liveData$1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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