2015-10-19 13 views
5

私は有効にしていると私はorg.apache.http.legacy.jarを使用していますし、私のGradle file.Iにjumblr Gradleのパスを追加した例外削除ファイル/ JAR /クラス

Error:Execution failed for task :app:packageAllDebugClassesForMultiDex'. 
> java.util.zip.ZipException: duplicate entry: org/apache/commons/codec/binary/Base64.class 

を取得しています、私はこれがあると思いますjumblrhttp legacyライブラリを使用しているので、私はhttp legacy libraryを明示的にjumblr gradle pathから削除する必要があると思います。特定のファイル/ jar/classをgradleパスから削除する方法を教えてください。

更新

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

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

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

     maven { 
      url "https://repo.commonsware.com.s3.amazonaws.com" 
     } 
     maven { 
      url "https://s3.amazonaws.com/repo.commonsware.com" 
     } 
    } 

    android { 
     useLibrary 'org.apache.http.legacy' 
     compileSdkVersion 23 
     buildToolsVersion "23.0.0" 
     dexOptions { 
      incremental true 
      javaMaxHeapSize "4g" 
     } 

     defaultConfig { 
      applicationId "com.example.myapp" 
      minSdkVersion 17 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
      // Enabling multidex support. 
      multiDexEnabled true 
     } 
     buildTypes { 
      debug { 
       shrinkResources true 
      } 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      } 
     } 
    // configurations { 
    //  all*.exclude group: 'org.apache', module: 'commons' 
    // } 
    } 

    dependencies { 

     // Enabling multidex support. 
     compile 'com.android.support:multidex:1.0.1' 
     //Other Libraries 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     compile files('libs/okhttp-2.2.0.jar') 
     compile files('libs/okhttp-urlconnection-2.2.0.jar') 
     compile files('libs/okio-1.2.0.jar') 
     compile files('libs/volley.jar') 
     compile files ('org.apache.http.legacy.jar') 
     compile files('libs/universal-image-loader-1.9.0.jar') 
     compile 'com.google.code.gson:gson:2.3' 
     compile 'com.android.support:cardview-v7:23.0.0' 
     compile 'com.android.support:recyclerview-v7:23.0.0' 
     compile 'com.android.support:appcompat-v7:23.0.0' 
     compile 'com.android.support:design:23.0.0' 
     compile 'com.jpardogo.materialtabstrip:library:1.1.0' 
     compile 'com.pkmmte.view:circularimageview:1.1' 
     // compile 'com.github.satyan:sugar:1.3' 
     compile 'com.squareup.picasso:picasso:2.5.2' 
     compile 'com.googlecode.mp4parser:isoparser:1.0.5.4' 
     compile 'org.bytedeco:javacv:1.0' 
     compile 'org.bytedeco.javacpp-presets:opencv:2.4.11-0.11:android-x86' 
     compile 'org.bytedeco.javacpp-presets:ffmpeg:2.6.1-0.11:android-x86' 
     compile 'org.bytedeco.javacpp-presets:opencv:2.4.11-0.11:android-arm' 
     compile 'org.bytedeco.javacpp-presets:ffmpeg:2.6.1-0.11:android-arm' 
     compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0' 
     compile project(':vidEffect') 
     //  For Endless adapter 
     compile 'com.commonsware.cwac:adapter:1.0.+' 
     compile 'com.commonsware.cwac:endless:1.2.3' 
     //  For Facebook 
     compile 'com.facebook.android:facebook-android-sdk:4.6.0' 
     //  For Twitter 
     compile('com.twitter.sdk.android:twitter:[email protected]') { 
      transitive = true; 
     } 
     compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
      transitive = true; 
     } 
     //  For Tumblr 
     compile files('libs/signpost-commonshttp4-1.2.jar') 
     compile files('libs/signpost-core-1.2.jar') 
     compile 'com.google.guava:guava:18.0' 
     compile project(':ViewPagerIndicator') 
      compile ('com.tumblr:jumblr:0.0.11'){ 
       transitive = true; 
       exclude module: 'Base64'; 
      } 
//Incase we have no choice but to use source code 
    // compile project(':jumblr') 
    } 

答えて

5

私はあなたが

compile('jumblr.jar') { 
    transitive = true; 
    exclude module: 'Base64'; 
} 

OR

compile ('com.tumblr:jumblr:0.0.11') { 
    transitive = true; 
    exclude module: 'Base64'; 
} 
+1

を除外@Niko Yuwonoを使用することができると思うのは、JARないようjumblrはGradleのパスとして追加されます。 –

+1

'org.apache.http.legacy.jar'は' jumblr'が 'gradle path'として追加されたjarファイルです。それらのクラスには同じクラスが含まれています.2つのライブラリファイルのいずれかから競合クラスを削除したい –

+0

@MuhammadUmairShafiqueあなたのbuild.gradleの依存関係を教えていただけますか? –

関連する問題