Skip to content

Android - Bundle release error #1340

@thiagobrez

Description

@thiagobrez

Hello all, and forgive me if this isn't the right place to ask, I've already asked on stack overflow with no response.

For some days now I've been stuck when trying to bundleRelease my React Native Android app using react-native-svg.

Error

Task :app:transformDexArchiveWithDexMergerForRelease FAILED
java.lang.RuntimeException: java.lang.RuntimeException: 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

I'm aware that this probably isn't a bug within react-native-svg but I came to ask for help if anyone has ever gone through this.

Apparently there's 2 or more dependencies trying to use BrushType and it throws this error.

  • I've already ran gradlew app:dependencies and can't find any library referencing Brush, com.horcrux.svg or react-native-svg.
  • Already tried cleaning project, deleting .iml files, invalidating Android Studio caches, rebuilding, reinstalling node_modules and so on
  • Tried messing with build.gradle and gradle.properties with no luck
  • I've read through this android guide on duplicate classes also with no luck

I imagine that once I find the libraries using BrushType, I could do something like

implementation(:my-library) {
  exclude ...
}

Correct?

I can't remember 100%, but somehow I got to suspect that this may be an issue with installing both react-native-svg and react-native-masked-view. Has anyone ever seen this?

Please consider that I only have basic understanding of Android development.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions