ParseLiveQuery
ParseLiveQuery copied to clipboard
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
This library produces next error when added to gradle:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Android Studio 3.0 this is my gradle file:
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support:design:26.1.0' compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" compile "org.jetbrains.anko:anko:$anko_version" implementation 'com.parse:parse-android:1.16.3' implementation 'com.github.tgio:parse-livequery:1.0.3' }
Fixed by excluding the okhttp library from other imports
compile ('com.parse:parse-android:1.16.3'){
exclude group: "com.squareup.okhttp3"
}
It worked with packagingOptions{ exclude 'META-INF/rxjava.properties' } added to gradle file.
I have the same problem, I tested both options: compile ('com.parse:parse-android:1.16.3'){ exclude group: "com.squareup.okhttp3" }
and packagingOptions{ exclude 'META-INF/rxjava.properties' }
None worked for me. This is my gradle file:
apply plugin: 'com.android.application'
android { compileSdkVersion 27 buildToolsVersion '26.0.2' defaultConfig { applicationId "com.yadercenteno.proyecto" minSdkVersion 14 targetSdkVersion 27 versionCode 24 versionName "1.15" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:27.0.2' compile 'com.android.support:design:27.0.2' compile 'com.google.firebase:firebase-storage:11.8.0' compile 'com.google.firebase:firebase-auth:11.8.0' compile 'com.google.firebase:firebase-database:11.8.0' compile 'com.google.firebase:firebase-crash:11.8.0' compile 'com.google.firebase:firebase-messaging:11.8.0' compile 'com.google.firebase:firebase-ads:11.8.0' compile 'com.google.firebase:firebase-config:11.8.0' compile 'com.google.firebase:firebase-appindexing:11.8.0' compile 'com.firebaseui:firebase-ui-database:1.0.1' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.okhttp3:okhttp:3.9.0' compile 'com.android.support:recyclerview-v7:27.0.2' compile 'com.android.support:cardview-v7:27.0.2' compile 'com.miguelcatalan:materialsearchview:1.4.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile ('com.parse:parse-android:1.16.6') { exclude group: "com.squareup.okhttp3:okhttp" } compile 'com.github.tgio:parse-livequery:1.0.3' testCompile 'junit:junit:4.12' }
apply plugin: 'com.google.gms.google-services'
Try something like below: implementation ('com.parse:parse-android:1.+',{ exclude group: "com.squareup.okhttp3" }) implementation ('com.github.tgio:parse-livequery:1.0.3', { exclude group: 'com.parse', module: 'parse-android' })