Error merging dex
AyokunlePaul opened this issue · 2 comments
Here's my build.gradle file(project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here's my build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
defaultConfig {
applicationId "i.am.eipeks.cloudinary"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation group: 'com.cloudinary', name: 'cloudinary-android', version: '1.20.0'
implementation 'com.pusher:pusher-java-client:1.5.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Below is the error message I'm getting
Information:Gradle tasks [clean, :app:assembleDebug]
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/cloudinary/Cloudinary;
Error:com.android.dex.DexException: Multiple dex files define Lcom/cloudinary/Cloudinary;
Error: at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
Error: at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
Error: at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
Error: at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Error: at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
Error: at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
Error: at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
Error: at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
Error: at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
Error: at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Error: at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Error: at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/cloudinary/Cloudinary;
Hi @Eipeks. Apologies for the late reply. It seems that you have 2 Cloudinary dependencies (or other dependency conflicts) with different versions. Could you please run gradle dependencies
and send us the output tree?
Closing this issue due to the time elapsed. Please feel free to either re-open the issue, contact our support at http://support.cloudinary.com or create a new ticket if you have any additional issues.