Android - Bundle release error
See original GitHub issueHello 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 referencingBrush
,com.horcrux.svg
orreact-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
andgradle.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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11
Top GitHub Comments
@visheshtungarev In my case, I had to exclude
react-native-svg
fromreact-native-jitsi-meet
, that was also using the library.I solved it by adding
But I think the group path may change, this module was compiled as an external sdk.
Hey @msand, thanks for the quick reply.
Yeah, I’ve tried that.
Actually, my
bundleRelease
did pass but it froze (probably crashed) on the splash screen. So I had to give up on Android for now due to tight schedule and I’m working only on refining my iOS app.I’ll try to make a repro this weekend if I have time, but I don’t really think it’ll happen on a clean new project.