2015-06-01 20 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