2016-09-22 65 views
0

当我试图RxPresso(https://github.com/novoda/rxpresso/)添加到我的项目时,此错误消息:错误添加RxPresso项目

Warning:Conflict with dependency 'io.reactivex:rxjava'. Resolved versions for app (1.1.9) and test app (1.0.14) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

我目前使用rxjava 1.1.9

。我如何在我的项目中添加RxPresso?

THX很多

回答

1

为了避免与RxJava和Android支持库版本有任何问题,请您app/build.gradle文件,并在dependencies部分贴:

androidTestCompile ('com.novoda:rxpresso:0.2.0') { 
    exclude group: 'com.android.support', module: 'support-annotations' 
    exclude group: 'io.reactivex' 
} 
+0

不错的一个!为我工作。谢谢 – NullPointer

1

你可以明确地告诉摇篮使用哪个版本,加入到你的build.gradle下一个片段

configurations.all { 
    // check dependency tree with gradlew :app:dependencies 

    // avoid wildcard '+' dependencies used at 3rd libraries forcing them to exact version 
    resolutionStrategy.force "io.reactivex:rxjava:1.1.9" 
} 
+0

这两种解决方案(你和piotrek1543)工作了我。非常感谢你! – NullPointer