2016-10-25 2 views
7

Ich habe Twitter-Login mit Fabrik-Plugin implementiert, nach der Einrichtung der Twitter-Integration, die ich mit diesem Problem konfrontiert bin, kann mir jemand vorschlagen, was ist falsch daran? Ich habe meine Größe und Logcat eingefügt.So lösen Sie java.util.zip.ZipException doppelten Eintrag: com/google/gson/Anmerkungen/Expose.class?

Gradle-Code

buildscript { 
     repositories { 
     maven { url 'https://maven.fabric.io/public' } 
      } 

     dependencies { 
      classpath 'io.fabric.tools:gradle:1.+' 
       } 
      } 
     apply plugin: 'com.android.application' 


    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
      } 


      android { 
      compileSdkVersion 23 
      buildToolsVersion "23.0.3" 

     defaultConfig { 
      applicationId "com.matrix_intech.manabitas" 
      minSdkVersion 15 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
      multiDexEnabled true 

      ndk { 
       moduleName "webp" 
      } 
      } 
      buildTypes { 
      release { 
     minifyEnabled false 
       proguardFiles getDefaultProguardFile 
       ('proguard-android.txt'), 'proguard-rules.pro' 
        } 
       } 

      sourceSets.main { 
      jniLibs.srcDir 'libs' 
       jni.srcDirs = [] //disable automatic ndk-build call 
       } 



      dexOptions { 
       javaMaxHeapSize "4g" 
      } 

      } 

      dependencies { 
     compile fileTree(include: ['*.jar'], dir: 'libs') 
     compile 'com.android.support:appcompat-v7:23.0.0' 
     compile files('libs/gson-2.3.1.jar') 
     compile files('libs/volley.jar') 
     compile files('libs/async.jar') 
     compile files('libs/async_loopj.jar') 
     compile 'com.squareup.picasso:picasso:2.5.2' 
     compile 'com.google.firebase:firebase-messaging:9.2.1' 
     compile 'com.google.android.gms:play-services:9.2.1' 
     compile 'com.android.support:multidex:1.0.0' 
     compile 'io.github.rockerhieu:emojicon:1.4.0' 

    //for video compression 
    //refer this url [https://github.com/lalongooo/VideoCompressor] 
    compile files('libs/aspectjrt-1.7.3 (1).jar') 
    compile files('libs/isoparser-1.0.6.jar') 

    compile 'com.facebook.android:facebook-android-sdk:4.6.0' 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
    transitive = true; 

    } 
    } 

    apply plugin: 'com.google.gms.google-services' 
    apply plugin: 'io.fabric' 

Logcat

 Information:Gradle tasks [:app:assembleDebug] 
     Warning:string 'telephone' has no default translation. 
     Error:Execution failed for task 
     ':app:transformClassesWithJarMergingForDebug'. 
     > com.android.build.api.transform.TransformException: 
     java.util.zip.ZipException: duplicate entry: 
     com/google/gson/annotations/Expose.class 
     Information:BUILD FAILED 

     Information:Total time: 3.682 secs 
     Information:1 error 
     Information:1 warning 
     Information:See complete output in console 

Antwort

7

Sie sollten exclude module: 'gson' von twitter dependency wie

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

Sie alre Ady hinzugefügt GSON als gson-2.3.1.jar

+1

Vielen Dank M D, du hast mein Leben gerettet ..... +1 für Sie. –

+0

@Addy Willkommen Addy .... –

Verwandte Themen