0

Whenever I try to build an APK for my project, this is the error I get:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lorg/json/simple/ItemList;

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "my.package.here"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'org.apache.clerezza.ext:org.json.simple:0.4'
    compile 'com.android.support:design:23.2.0'
}

I think that means that more than one dependency defines ItemList. I know one is org.json.simple, what is the other one?

How do I properly exclude ItemList from one of them?

there's nothing in my libs folder so that's not the problem

1 Answers1

1

replace this compile 'org.apache.clerezza.ext:org.json.simple:0.4'

with

compile('com.googlecode.json-simple:json-simple:1.1.1') {
    exclude group: 'org.hamcrest', module: 'hamcrest-core'
}

the source is here: click link

Michael
  • 588
  • 11
  • 19