使用Retrofit rxjava 导入依赖
/*rx-android-java*/ compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' compile 'com.trello:rxlifecycle:1.0' compile 'com.trello:rxlifecycle-components:1.0' /*rotrofit*/ compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.0.0' compile 'com.google.code.gson:gson:2.8.0' compile 'com.jakewharton:butterknife:7.0.1'
报错
Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (3.0.1) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details
解决方法
在项目的app根目录中build.gradle中的
……
configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' }
}
OK 啦