使用Joda Time进行Multidex重复输入

时间:2015-06-01 16:15:22

标签: android jodatime multidex

我刚为我的应用启用了Multidex支持,现在我从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:2.9.8@aar') {
        transitive = true
    }
    compile 'com.mikepenz.iconics:octicons-typeface:2.2.0@aar'
    compile 'com.mikepenz:community-material-typeface:1.0.0@aar'
    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:1.8.5@aar') {
        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:1.4.0@aar'
    compile 'me.leolin:ShortcutBadger:1.1.1@aar'
    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:1.5@aar'
    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.'

}

1 个答案:

答案 0 :(得分:3)

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

//这取决于它。可能导致问题。'

根据mvnrespository.com,这个库依赖于joda-time本身,所以它可能是一个重复的条目

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

应该做的伎俩