2015-06-09 6 views
5

Ich habe die Digits mobile SDK in mein Projekt integriert und es würde nicht mehr gebaut werden. Es hat eine Art von Konflikt mit der Gson-Bibliothek, die ich benutze. Ich erhalte diese Störung während des Build:Gradle Duplicate Eintrag

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. 
> java.util.zip.ZipException: duplicate entry: com/google/gson/Gson$5.class 

dies mein build.gradle ist

buildscript { 
    repositories {maven { url 'https://maven.fabric.io/public' }} 
    dependencies {classpath 'io.fabric.tools:gradle:1.+'}} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 
android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.0" 
    defaultConfig {...} 
    buildTypes {release {...}} 
    dexOptions {preDexLibraries = false 
    incremental true 
    javaMaxHeapSize "4g"} 
    packagingOptions {...}} 
repositories { 
    mavenCentral() 
    maven { url 'https://maven.fabric.io/public' }} 
dependencies { 
    ... 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true;} 
    compile 'io.branch.sdk.android:library:1.5.5' 
    compile('com.digits.sdk.android:digits:[email protected]') { 
     transitive = true;}} 
+0

ist Digits mobile SDK importiert mit einer Jar-Bibliothek? –

+0

nein diese Abhängigkeiten verwenden kompilieren ('com.digits.sdk.android:digits:[email protected]') { transitive = true; } –

+0

haben Sie versucht, das Projekt zu säubern? –

Antwort

6

dies die Lösung

compile('com.digits.sdk.android:digits:[email protected]') { 
    transitive = true; 
    exclude module: 'gson'; 
} 

Sie Modul hinzufügen müssen, ist auszuschließen: 'Gson'