大海话语 2021-11-24 09:07 采纳率: 87.6%
浏览 207
已结题

使用 okhttp3时,依赖冲突了,也不知道是不是,怎样解决呢?

我今天在使用一个 okhttp3时,应该是依赖冲突了。

//Okhttp依赖
implementation("com.squareup.okhttp3:okhttp:4.4.0")

//bmob依赖
implementation 'cn.bmob.android:bmob-im:2.1.1@aar'
    implementation 'cn.bmob.android:bmob-sdk:3.6.3'

下面是报错信息

Duplicate class okio.AsyncTimeout found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.AsyncTimeout$Watchdog found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Buffer found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.BufferedSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.BufferedSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.ByteString found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.DeflaterSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.ForwardingSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.ForwardingSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.ForwardingTimeout found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.GzipSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.GzipSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.HashingSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.HashingSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.InflaterSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Okio found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Options found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Pipe found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.RealBufferedSink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.RealBufferedSource found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Segment found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.SegmentPool found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.SegmentedByteString found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Sink found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Source found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Timeout found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)
Duplicate class okio.Utf8 found in modules jetified-bmob-sdk-3.6.3-runtime (cn.bmob.android:bmob-sdk:3.6.3) and jetified-okio-jvm-2.4.3 (com.squareup.okio:okio:2.4.3)

Go to the documentation to learn how to Fix dependency resolution errors.


  • 写回答

2条回答 默认 最新

  • pumpkin的玄学 2021-11-24 09:24
    关注

    排除掉依赖
    比如

        implementation('cn.bmob.android:bmob-sdk:3.6.3') {
            exclude group: 'com.squareup.okio', module: 'okio:2.4.3'
        }
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 12月2日
  • 已采纳回答 11月24日
  • 赞助了问题酬金 11月24日
  • 创建了问题 11月24日

悬赏问题

  • ¥30 easy photo不能使用,求帮助
  • ¥15 c语言字符串单词入门问题报错
  • ¥30 我现在是双非人工智能专业不知道要不要转到软件工程专业
  • ¥15 请问12脉波整流机组的外特性曲线具体是如何推导
  • ¥15 abaqus里的python算法
  • ¥100 如何在思科模拟器中进入CEF模式
  • ¥15 Simulink 仿真如何使用MATLAB function模块获取到仿真过程中某一仿真时刻输入到模块的函数的值?
  • ¥50 关于#微信小程序#的问题:微信小程序支持h5实现webrtc h264 h265低延迟传输渲染,能付费帮我们解决一下吗
  • ¥20 请问ansys License manager 这个问题如何解决
  • ¥15 memory.limit()' is no longer supported