首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >具有rx-java重复项的transorm异常

具有rx-java重复项的transorm异常
EN

Stack Overflow用户
提问于 2017-01-30 00:17:26
回答 1查看 593关注 0票数 3

错误:任务':app:transformClassesWithJarMergingForDebug'.执行失败

com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目:rx/可观察的$23.class

这是build.gradle文件。

代码语言:javascript
复制
buildscript {
repositories {
    jcenter()
}

dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 23
    versionName "1.1"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'),      'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/services/javax.annotation.processing.Processor'
}

// Enable Java 7 features (diamond operator, string switch statements, etc.)
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//    testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.3'
compile 'com.squareup:otto:1.3.6'
compile 'com.github.frankiesardo:icepick:2.3.6'
provided 'com.github.frankiesardo:icepick-processor:2.3.6'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'org.parceler:parceler:0.2.9'
compile 'com.netflix.rxjava:rxjava-android:0.20.7'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'io.reactivex:rxjava-computation-expressions:0.21.0'
}
EN

回答 1

Stack Overflow用户

发布于 2017-01-30 07:20:33

问题

编译‘com.netflix.rxjava:rxjava:0.20.7’/这里的问题 编译'io.reactivex:rxjava-computation-expressions:0.21.0‘

调用io.reactivex而不是

终于

代码语言:javascript
复制
compile  'io.reactivex.rxjava2:rxjava:2.0.1'
compile  'io.reactivex:rxjava-computation-expressions:0.21.0'

然后清理-重建和运行。

编辑

您应该使用最新的稳定版本。

代码语言:javascript
复制
compileSdkVersion 25
buildToolsVersion "25.0.1"
targetSdkVersion 25
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41927441

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档