zoukankan      html  css  js  c++  java
  • 使用Rxjava和Retrofit报错--01

    如下所示,编译时报错:

    Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
        File1: C:Userslhw.gradlecachesmodules-2files-2.1io.reactivex.rxjava2
    xjava2.0.157f850a6b317e5582f1dbaff10a9e7d7e1fcdcfb
    xjava-2.0.1.jar
        File2: C:Userslhw.gradlecachesmodules-2files-2.1io.reactivex
    xjava1.2.042bfaf64c94f3848ebf5cf1c2ea4ec9d1b3ac6c8
    xjava-1.2.0.jar

    解决方法:

    报错原因是因为依赖错误:

    修改如下:

      compile 'com.squareup.retrofit2:retrofit:2.2.0'
        //compile 'com.squareup.retrofit2:adapter-rxjava:1.0.0'
        compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
        compile 'com.squareup.retrofit2:converter-gson:2.2.0'

    修改依赖后注意修改一下代码:

  • 相关阅读:
    Docker理解
    提高服务器并发量,有关系统配置的常规方法
    Linux EXT 文件系统 详解
    jvm入门
    2020-1-08.运维面试题总结
    hexo+gitee
    rsync
    haddop3.2.1完全分布式安装
    zabbix02
    zabbix监控工具问题集
  • 原文地址:https://www.cnblogs.com/pili/p/6877024.html
Copyright © 2011-2022 走看看