【发布时间】:2023-02-16 18:48:46
【问题描述】:
我正在做一个反应本机项目,我必须在其中集成缩放视频 sdk。首先,我在使用 zoom 1.2.0 版,然后我不得不将它升级到 1.5.3 版。升级后,应用程序构建并在调试模式下正常工作,但当我尝试生成应用程序或执行捆绑发布时,它返回此错误。
`* 出了什么问题: 任务 ':app:mergeDexRelease' 执行失败。
执行 com.android.build.gradle.internal.tasks.DexMergingTaskDelegate 时发生故障 执行工作项时失败 > 执行 com.android.build.gradle.internal.tasks.DexMergingWorkAction 时发生故障 > com.android.builder.dexing.DexArchiveMergerException:合并 dex 档案时出错: a.a 类型定义了多次:/Users/macbookpro/Desktop/healing-center-mobile/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dex, /Users/macbookpro/Desktop/healing-center-mobile /android/mobilertc/build/.transforms/e16cb3969562dbd5409148a5e09af52c/transformed/jetified-mobilertc-runtime/classes.dex 在https://developer.android.com/studio/build/dependencies#duplicate_classes 了解如何解决问题。
- 尝试:
使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获得更多日志输出。 使用 --scan 运行以获得完整的见解。`
我搜索它,那里有很多解决方案,比如添加
dependenciesInfo { // Disables dependency metadata when building APKs. includeInApk = false // Disables dependency metadata when building Android App Bundles. includeInBundle = false }在 app/build.gradle 中或添加
multiDexEnabled true和implementation 'androidx.multidex:multidex:2.0.1'或将排除模型添加到 app/build.gradle
implementation (project(':mobilertc')) { exclude module: 'duplicated module' }中的项目或者通过添加到 build.gradle
implementation("com.google.guava:guava:24.0-jre")我还尝试使 android 的缓存无效,删除节点模块并重新安装。 但总是同样的错误。 那么有人可以帮忙吗?
【问题讨论】:
标签: android react-native mobile apk zoom-sdk