Duplicate recording using Parse and Multidex

My project is a chat application that uses Parse. After adding other dependencies, this problem started to appear:

Error: execution completed for task ': app: dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: process 'command' / usr / lib / jvm / java-7-oracle / bin / java '' exited with nonzero value 2

Searching StackOverflow, some people told me that this could be a 65K limitation from Android. So, to solve, I followed these steps:

1 - Add Multidex

DefaultConfig {         multiDexEnabled true } 

and

 compile 'com.android.support:multidex:1.0.0' 

https://developer.android.com/tools/building/multidex.html

2 - Enable Jumbo Mode in Android Gradle Settings

  dexOptions { jumboMode = true } 

I cleaned up the project and started the Gradle construct. This did not cause errors. Large! But when I click "Run Application", it generates this error below.

Error: execution failed for task ': app: packageAllDebugClassesForMultiDex. > Java.util.zip.ZipException: double entry: bolts /AggregateException.class

If I remove the dependency "com.parse.bolts: bolts-android: 1. +" the "Run the application" works, but I can not do without the dependence on the "Analysis" parameter.

This is my Gradle build script:

 apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "br.com.triangulum.mink" minSdkVersion 18 targetSdkVersion 22 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { jumboMode = true } } repositories { mavenCentral() } dependencies { compile 'com.parse.bolts:bolts-android:1.+' compile('com.android.support:multidex:1.0.0') { exclude group: 'com.parse.bolts', module: 'bolts-android' } androidTestCompile 'com.android.support:multidex-instrumentation:1.0.0' compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: 'Parse*.jar') compile project('libraries:httprequest') compile project('libraries:cameralibrary') compile project('libraries:bgarefreshlayout') compile 'com.android.support:appcompat-v7:+' compile 'com.android.support:recyclerview-v7:+' compile 'com.android.support:cardview-v7:+' compile 'com.android.support:palette-v7:+' compile 'com.android.support:design:+' compile 'com.daimajia.swipelayout:library: 1.2.0@aar ' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.google.code.gson:gson:2.2.+' compile 'com.squareup.picasso:picasso:2.4.0' compile 'com.jakewharton:butterknife:7.0.1' compile 'com.afollestad:material-dialogs:0.7.4.0' compile 'com.getbase:floatingactionbutton:1.10.0' compile 'com.facebook.android:facebook-android-sdk:4.1.0' compile 'de.greenrobot:eventbus:2.4.+' compile'com.edmodo:cropper:1.0.+' compile 'com.github.ksoichiro:android-observablescrollview:+' compile 'com.etsy.android.grid:library:1.0.5' compile('com.mikepenz:actionitembadge: 3.0.2@aar ') { transitive = true } compile 'com.daimajia.swipelayout:library: 1.2.0@aar ' compile 'com.android.support:multidex:1.0.+' } 
+4
source share
2 answers

try changing this:

 compile('com.android.support:multidex:1.0.0') { exclude group: 'com.parse.bolts', module: 'bolts-android' } 

For this:

 compile('com.android.support:multidex:1.0.0'); 

the bolds module is sometimes used to fix duplicated dexLibs

Hi

+3
source

Your library com.facebook.android:facebook-android-sdk:4.1.0 with the parsing since they use the same bolt-android module inside and have a different version of this module. Try to exclude this module from any parsing or facebook gradle dependency.

 compile('com.facebook.android:facebook-android-sdk:4.1.0') { exclude group: 'com.parse.bolts', module: 'bolts-android' } 

I had the same problem, and when I ran ./gradlew yourModuleName:dependencies using the terminal, I found that it was two libraries that interacted with each other with another version of the same module.

0
source

All Articles