我正在使用Android Studio 1.5,我的gradle如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 14
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.beatzplayer"
minSdkVersion 14
targetSdkVersion 14
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
minifyEnabled false
}
}
}
dependencies {
compile files('libs/jl1.0.1.jar')
compile files('libs/JLayer1.0.1.jar')
compile files('libs/mp3spi1.9.4.jar')
compile files('libs/tritonus_share.jar')
}
我同步,清理并重建了Gradle但是当我选择设备后尝试运行应用程序时,应用程序给了我这个错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: javazoom/jl/converter/Converter$PrintWriterProgressListener.class
之后,我读了Error after adding play-services library : ':app:transformClassesWithJarMergingForDebug'所以我添加以下代码:
compile('libs/JLayer1.0.1.jar') {
exclude module: 'converter'
}
当我再次同步gradle时,它报告了我这个:
Error:(29, 0) Gradle DSL method not found: 'exclude()'
我错误的说你有一个不同名称的jar文件有相同的类
compile files('libs/jl1.0.1.jar')
compile files('libs/JLayer1.0.1.jar')
如果不再需要删除,那么两者都是相同的,而不是再次构建classl