gpt4 book ai didi

android - 从 android studio 中的 gradle 路径中删除文件/jar/类

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:36:28 33 4
gpt4 key购买 nike

我启用了 multidex,我正在使用 org.apache.http.legacy.jar 并添加了 jumblr我的 gradle 文件中的 gradle 路径。我遇到异常

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

我认为这是因为 jumblr 也在使用 http legacy 库,所以我认为我需要从 jumblr gradle 路径。请让我知道如何从 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')
}

最佳答案

我认为你可以使用exclude

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

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

关于android - 从 android studio 中的 gradle 路径中删除文件/jar/类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33208804/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com