2015-06-01 51 views
0

我剛剛爲我的應用程序啓用了Multidex支持,現在我從我的Joda時間依賴項中獲取此錯誤。多重索引與Joda時間重複條目

我也在使用依賴Joda的庫gson-jodatime-serialisers。不知道它是否導致重複問題。

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. 
    > java.util.zip.ZipException: duplicate entry: org/joda/time/base/AbstractDateTime.class 

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 



    defaultConfig { 
     applicationId "com.wake.social" 
     minSdkVersion 14 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
     manifestPlaceholders = [ localApplicationId:applicationId ] 

     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

repositories { 
    jcenter() 
    mavenCentral() 
    maven { 
     url "https://oss.sonatype.org/content/repositories/snapshots/" 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:22.1.1' 
    compile('com.mikepenz:materialdrawer:[email protected]') { 
     transitive = true 
    } 
    compile 'com.mikepenz.iconics:octicons-typeface:[email protected]' 
    compile 'com.mikepenz:community-material-typeface:[email protected]' 
    compile 'com.squareup.okhttp:okhttp:2.4.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.jakewharton:butterknife:6.1.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.1.0' 
    compile 'com.squareup.retrofit:retrofit:1.9.0' 
    compile('de.keyboardsurfer.android.widget:crouton:[email protected]') { 
     exclude group: 'com.google.android', module: 'support-v4' 
    } 
    compile 'com.afollestad:material-dialogs:0.7.4.2' 
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' 
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' 
    compile 'com.github.satyan:sugar:1.3.1' 
    compile 'com.google.android.gms:play-services-gcm:7.5.0' 
    compile 'eu.inloop:easygcm:[email protected]' 
    compile 'me.leolin:ShortcutBadger:[email protected]' 
    compile 'com.getbase:floatingactionbutton:1.9.0' 
    compile 'com.mobsandgeeks:android-saripaar:2.0-SNAPSHOT' 
    compile 'com.squareup:otto:1.3.7' 
    compile 'uk.co.chrisjenx:calligraphy:2.1.0' 
    compile 'com.github.navasmdc:MaterialDesign:[email protected]' 
    compile 'com.github.traex.rippleeffect:library:1.3' 
    compile ("com.doomonafireball.betterpickers:library:1.6.0") { 
     exclude group: 'com.android.support', module: 'support-v4' 
    } 
    compile 'net.danlew:android.joda:2.7.2' 
    compile 'com.rengwuxian.materialedittext:library:2.1.3' 
    compile 'com.android.support:multidex:1.0.0' 
    compile ''com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serialisers:1.1.0' //this depends on it. Could be causing the problem.' 

} 
+0

後您gradle這個文件請。 –

+0

@Videndeta發佈了 –

回答

2
compile ''com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serialisers:1.1.0' 

//這依賴於它。可能會導致問題。'

根據mvnrespository.com,這個庫依賴於喬達,時間本身,因此它可能是一個重複的條目

compile ("com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serializers:1.1.0") { 
    exclude module: 'joda-time' 
} 

應該做的伎倆

+0

或排除組:'org.joda.time' – ijunes