Android-任务:应用程序:mergeDexRelease失败 请考虑我对Android开发不太熟悉。
尝试为我的React本机应用程序生成Android签名包时,我偶然发现以下错误:Android-任务:应用程序:mergeDexRelease失败 请考虑我对Android开发不太熟悉。,android,react-native,gradle,dex,react-native-svg,Android,React Native,Gradle,Dex,React Native Svg,尝试为我的React本机应用程序生成Android签名包时,我偶然发现以下错误: Task :app:mergeDexRelease FAILED D8: Program type already present: com.horcrux.svg.Brush$BrushType com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve
Task :app:mergeDexRelease FAILED
D8: Program type already present: com.horcrux.svg.Brush$BrushType
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at
https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.horcrux.svg.Brush$BrushType
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.horcrux.svg.Brush$BrushType
- 我知道
是来自BrushType
react native svg
- 我运行了
,没有发现依赖于gradlew app:dependencies
或任何与Brush
或com.horcrux.svg
相关的模块react native svg
- 已尝试清理project、删除
文件、使Android Studio缓存无效、重建、重新安装.iml
节点模块等
- 没有运气尝试过混搭
和build.gradle
gradle.properties
- 我也读了一遍,运气也不好
com.horcrux.svg.Brush$BrushType
,但我找不到它们。我想一旦我找到他们,我就能
implementation(:my-library) {
exclude ...
}
对吗
格拉德尔酒店
android/app/build.gradle
提前谢谢
编辑:
通过添加以下内容解决:
implementation(project(':react-native-jitsi-meet')) {
...
exclude group: 'com.facebook.react',module:'react-native-svg'
...
}
在我的案例中,是
react native jitsi meet
导致了冲突,我必须通过试错来找到它。找到了这个问题的解决方案吗?找到了吗?@jazzbpn我用我的案例的解决方案更新了帖子,它终于起作用了
defaultConfig {
..............
multiDexEnabled true
}
dependencies {
..............
implementation 'androidx.multidex:multidex:2.0.1'
}
public class MyApplication extends MultiDexApplication {
..............
}
implementation(project(':react-native-jitsi-meet')) {
...
exclude group: 'com.facebook.react',module:'react-native-svg'
...
}
defaultConfig {
..............
multiDexEnabled true
}
dependencies {
..............
implementation 'androidx.multidex:multidex:2.0.1'
}
public class MyApplication extends MultiDexApplication {
..............
}