question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

See original GitHub issue

Hi a’m using version 1.4.4. gradle - 4.5-all Initting

  BoxStore store = MyObjectBox
                .builder()
                .androidContext(context)
                .debugFlags(DebugFlags.LOG_QUERIES)
                .build();
        if (BuildConfig.DEBUG) {
            new AndroidObjectBrowser(store).start(context);
        }

But always at compiling getting same error

What went wrong: Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDevDebug’. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

My module.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    debugCompile "io.objectbox:objectbox-android-objectbrowser:1.4.4"
    releaseCompile "io.objectbox:objectbox-android:1.4.4"

    compile project(':libs:data_provider:plugins:resources')
}
apply plugin: 'io.objectbox'

Top .gradle

buildscript {

    apply from: 'versions.gradle'

    repositories {
        jcenter()
        mavenLocal()
        mavenCentral()
        maven { url 'https://maven.google.com' }
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jcenter.bintray.com" }
        maven { url "https://jitpack.io" }
        maven { url "http://objectbox.net/beta-repo/" }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
        classpath "com.android.tools.build:gradle:3.0.1"
        classpath "me.tatarka:gradle-retrolambda:3.6.1",
        classpath "com.github.dcendents:android-maven-gradle-plugin:1.4.1"
        classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"
        classpath "io.objectbox:objectbox-gradle-plugin:1.4.4"
    }
}
...
allprojects {
    repositories {
        mavenCentral()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jcenter.bintray.com" }
        maven { url "https://jitpack.io" }
        maven { url "http://objectbox.net/beta-repo/" }
    }
}

But when i compile without objectbrowser - there’s no any problem

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    compile "io.objectbox:objectbox-android:1.4.4"

    compile project(':libs:data_provider:plugins:resources')
}
apply plugin: 'io.objectbox'

Objectbox is using in android module (apply plugin: ‘com.android.library’) . What problem can be?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
EnterPrayzcommented, Mar 26, 2018

Pretty working. I found problem. In my case im using multiple sub modules, and by my negligence I added dependence on the library in another module.

database.gradle


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    debugImplementation("io.objectbox:objectbox-android-objectbrowser:$versions.objectboxVersion")
    releaseImplementation "io.objectbox:objectbox-android:$versions.objectboxVersion"
    ...
}
apply plugin: 'io.objectbox'

anothermodule.gradle


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation "io.objectbox:objectbox-android:$versions.objectboxVersion"
...
}

Thank for responding. Have a nice day.

0reactions
joekubocommented, Jul 7, 2020

just type ‘cordova clean android’ on your terminal in the root folder of your project

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Unable to merge dex - Stack Overflow
Go to project structure and find out the external library which is using a different version. Double click on it and delete its...
Read more >
Unable to merge dex error when the library was used ... - GitHub
RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex**. After running stacktrace on screenshotTest.
Read more >
Build Failed with an Exception – Unable to merge dex
RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex. Solução: 1) Vá até o android/app/build.gradle.
Read more >
Android Studio Rebuild DexArchiveMergerException Unable ...
When you build an android project in android studio, you may encounter DexArchiveMergerException unable to merge dex exception. The detailed error message ...
Read more >
DexArchiveMergerException: Unable to merge dex
DexArchiveMergerException : Unable to merge dex. I've tried implementing unity Admob but ... RuntimeException: com.android.builder.dexing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found