negativetwelve / react-native-ux-cam

React Native wrapper for uxcam.com
53 stars 36 forks source link

Error while merging dex archives: Program type already present: com.uxcam.internals.aa #103

Closed cereme closed 5 years ago

cereme commented 5 years ago

I ran react-native run-android and met:

Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
Program type already present: com.uxcam.internals.aa
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

My env

Host: mac OS 10.14.6
react-native: 0.60.6
react-native-ux-cam: 5.1.10
gradle: 3.4.1

My root level build.gradle file:

//...
allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven { url "http://sdk.uxcam.com/android/" }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenLocal()
        google()
        jcenter()
    }
}
cereme commented 5 years ago

It was my fault

feedcast-me commented 5 years ago

Happened the same thing to me

@cereme how did you fix it?

cereme commented 5 years ago

@feedcast-me I got this error not only RNUxcam, but also other packages. Make sure your build.gradle files are correctly configured. In my case, I was migrating from 0.59 to 0.60, I missed some lines in app level build.gradle