This is a screenshot from the duplicated classes当我开始集成Digits时,我每次在Marshmallow设备上构建应用程序后升级后都必须升级Crashlytics我得到了构建错误这个
错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / crashlytics / android / answers / shim / AnswersKitEventLogger.class
搜索了一段时间之后,我已经尝试了./gradlew clean命令,我认为有两个类具有相同的名称ANswersKitEventLooger.class其中一个在answer-shim-0.0.3 Crashlytics中的库和另一个在分支库中的answer-shim-0.0.4下
我也试着在build.gradel中删除,但到目前为止似乎没有任何工作 `
buildscript {
repositories {
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' }
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.facebook.android:facebook-android-sdk:4.8.0+'
compile 'com.xgc1986.android:parallaxpagertransformer:1.0.3'
compile 'com.facebook.rebound:rebound:0.3.7'
compile 'com.ogaclejapan.smarttablayout:library:1.1.3@aar'
compile files('libs/AudienceNetwork.jar')
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/ebizu-redemption.jar')
compile files('libs/universal-image-loader-1.9.1.jar')
compile files('libs/zxing-core.jar')
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
compile 'io.branch.sdk.android:library:1.+'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.android.support:multidex:1.0.1'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.1@aar') {
transitive = true;
}
}
`
答案 0 :(得分:3)
此问题已在Branch SDK v2.1.0中修复
答案 1 :(得分:1)
这看起来像是一起使用分支和数字引起的问题。两者都使用answers-shim
模块。简单的解决方法是从Branch或Digits中排除answers-shim
。 build.gradle中的以下内容正常工作
compile 'io.branch.sdk.android:library:1.+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.1@aar') {
transitive = true;
exclude module: 'answers-shim'
}
答案 2 :(得分:0)
以下gradle配置适用于我。
compile('com.twitter.sdk.android:twitter:1.14.1@aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
transitive = true;
}
compile('io.fabric.sdk.android:fabric:1.3.12@aar') {
transitive = true;
}
compile('io.branch.sdk.android:library:1.14.0@aar') {
transitive = true;
}