应用程序/的build.gradle
以前,这同一个项目工作正常了Android 1.5的工作室,但更新Android工作室之后2.1.1未能建立apk文件错误信息:错误:执行失败的任务“:应用程序:transformClassesWithJarMergingForRelease”。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:组织/ ObjectWeb联盟/ ASM / AnnotationVisitor.class
而在试图建立发布APK错误的情况是:错误:执行失败的任务“:应用程序:transformClassesWithJarMergingForRelease”。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:组织/ ObjectWeb联盟/ ASM /公/ AdviceAdapter.class
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
// generatedDensities = []
applicationId "com.view9.lacuna"
minSdkVersion 15
targetSdkVersion 23
versionCode 3
versionName "3.0"
multiDexEnabled true
signingConfig signingConfigs.newSigningConfig
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode = true
incremental true
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.newSigningConfig
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
}
}
packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/BCKEY.DSA'
exclude 'AUTHORS'
exclude 'META-INF/BCKEY.SF'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
// set to true to turn off analysis progress reporting by lint
quiet false
// if true, stop the gradle build if errors are found
abortOnError true
// if true, only report errors
ignoreWarnings false
// turn off checking the given issue id's
disable 'TypographyFractions', 'TypographyQuotes'
// if true, generate a text report of issues (false by default)
textReport true
}
productFlavors {
}
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.tools.build:gradle:2.0.0'
compile('com.android.support:appcompat-v7:23.0.0') {
exclude module: 'support-v4'
}
compile 'com.google.android.gms:play-services:9.0.2'
compile 'it.sephiroth.android.library.horizontallistview:hlistview:1.2.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'fr.baloomba:viewpagerindicator:2.4.2'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.github.clans:fab:1.5.5'
compile 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
compile 'commons-validator:commons-validator:1.4.0'
compile 'it.neokree:MaterialTabs:0.11'
compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
compile('org.apache.httpcomponents:httpmime:4.4.1') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile('com.github.afollestad.material-dialogs:core:0.8.5.7@aar') {
transitive = true
}
compile 'com.squareup:otto:1.3.5'
compile 'com.android.support:multidex:1.0.1'
}
我挣扎着这一个几天还有,完全相同的错误字对字。我的经历和阅读所有的答案,我能找到的和不断添加的东西到我的gradle这个文件,但似乎没有任何工作。所以,我去的其他方式,并简化了我的问题。
1)开始用没什么新鲜的模块内,除了什么Android Studio中创建时补充道。调试应用程序,并建立了一个签名的APK。这将成为我的底线。
2。)开始添加,我需要一个接一个,调试装置和创建每个一个接一个带符号的apk的库。基本的前提是,由于基线调试和建就好了,这打破了能力的任何图书馆的罪魁祸首。
3)最后来到了我的情况的罪魁祸首:
compile 'com.google.gms:google-services:2.1.2'
有了这条线包括了应用程序将调试,但不会建立一个签署发布的APK,所以我删除线,并试图再次和它的工作如预期。
这个配置没有出现,我需要它的测试后,不为什么它在那里,如果没有必要,但这个对我来说是什么工作。很显然,你不会有这样的完全相同的问题,但我斗胆,它有事情做与谷歌图书馆。希望这可以帮助!
我有同样的问题,当我转换一个Java类到科特林级。我想,其原因是,有一些老x.class文件在build文件夹离开。
你可以在你的电脑搜索类AdviceAdapter.class。然后,当你发现它们全部删除。它应该工作之后。