我启用了multidex,我正在使用org.apache.http.legacy.jar并在我的gradle文件中添加了jumblr gradle路径.我得到了异常
Error:Execution Failed for task :app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: org/apache/commons/codec/binary/Base64.class
我想这是因为jumblr也在使用http遗留库,所以我想我需要从jumblr gradle路径中明确删除http遗留库.请告诉我如何从gradle路径中删除特定的文件/ jar /类.
更新
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:1.8.0@aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
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')
}
解决方法:
我想你可以使用排除
compile('jumblr.jar') {
transitive = true;
exclude module: 'Base64';
}
要么
compile ('com.tumblr:jumblr:0.0.11') {
transitive = true;
exclude module: 'Base64';
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。