Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-任务:应用程序:mergeDexRelease失败 请考虑我对Android开发不太熟悉。_Android_React Native_Gradle_Dex_React Native Svg - Fatal编程技术网

Android-任务:应用程序:mergeDexRelease失败 请考虑我对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

尝试为我的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 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、删除
    .iml
    文件、使Android Studio缓存无效、重建、重新安装
    节点模块等
  • 没有运气尝试过混搭
    build.gradle
    gradle.properties
  • 我也读了一遍,运气也不好
我知道有2个或更多依赖项使用
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 {
    ..............
}