gradle java文件合并_java – 从Gradle依赖中排除.class文件

我试图导入

https://github.com/Kickflip/kickflip-android-sdk使用渐变到我的Android构建,我得到:

UNEXPECTED TOP-LEVEL EXCEPTION:

com.android.dex.DexException: Multiple dex files define Lorg/apache/commons/codec/binary/Base64;

Commons.codec是我项目的依赖,而不是直接的踢翻项目,我认为它来自其中一个罐子.我可以看到.class文件,如果我打开Kickflip的classes.jar.

如何将Base64.class从kickflip导入最终构建?我已经看过使用ziptree来排除东西,但是还没有得到任何工作.

谢谢

我的build.gradle是:

apply plugin: 'android'

android {

compileSdkVersion 19

buildToolsVersion "19.0.3"

defaultConfig {

minSdkVersion 10

targetSdkVersion 19

versionCode 1

versionName "1.0"

}

buildTypes {

release {

runProguard false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'

}

}

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_7

targetCompatibility JavaVersion.VERSION_1_7

}

packagingOptions {

exclude 'META-INF/DEPENDENCIES.txt'

exclude 'META-INF/LICENSE.txt'

exclude 'META-INF/NOTICE.txt'

exclude 'META-INF/NOTICE'

exclude 'META-INF/LICENSE'

exclude 'META-INF/DEPENDENCIES'

exclude 'META-INF/notice.txt'

exclude 'META-INF/license.txt'

exclude 'META-INF/dependencies.txt'

exclude 'META-INF/LGPL2.1'

exclude 'META-INF/ASL2.0'

}

android.applicationVariants.all{ variant ->

// This is an annoying hack to get around the fact that the Gradle plugin does not support

// having libraries with different minSdkVersions. Play Services has a min version of 9 (Gingerbread)

// but Android Maps Utils supports 8 (Froyo) still

variant.processManifest.doFirst {

File manifestFile = file("${buildDir}/exploded-aar/io.kickflip/sdk/0.9.9/AndroidManifest.xml")

if (manifestFile.exists()) {

println("Replacing minSdkVersion in Android Maps Utils")

String content = manifestFile.getText('UTF-8')

content = content.replaceAll(/minSdkVersion="18"/, 'minSdkVersion=\"10\"')

manifestFile.write(content, 'UTF-8')

println(content)

}

}

}

}

dependencies {

compile 'com.android.support:support-v4:19.1.0'

compile 'io.kickflip:sdk:0.9.9'

compile fileTree(dir: 'libs', include: '*.jar')

compile project(':libs:typeface-textview:library')

compile project(':libs:gpuimage')

compile 'com.google.android.gms:play-services:4.3.23'

compile 'com.nineoldandroids:library:2.4.0'

compile 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'

compile ('fr.avianey:facebook-android-api:3.14.0') {

exclude module: 'support-v4'

}

compile 'com.github.japgolly.android:svg-android:2.0.1'

compile 'org.scribe:scribe:1.3.5'

compile 'commons-codec:commons-codec:1.8'

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值