前言

今天使用一个插件包的时候,依赖包冲突了,在此记录一下。

正文

在引用一个:

debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'

然后报错出现冲突。

Duplicate class okio.AsyncTimeout found in modules ksoap2-android-assembly-3.6.3-jar-with-dependencies.jar (ksoap2-android-assembly-3.6.3-jar-with-dependencies.jar) and okio-2.2.2.jar (com.squareup.okio:okio:2.2.2)

那么你要做的事是移除它,让两者存在一个。

debugImplementation ('com.squareup.leakcanary:leakcanary-android:2.2',{
    exclude group: 'com.squareup.okio', module: 'okio'
  })

这个怎么写的呢?根据后面的(com.squareup.okio:okio:2.2.2) 中的内容。

然後又有一個錯誤:

org.aspectj.weaver.BCException: Whilst processing type 'Lleakcanary/internal/activity/screen/HeapAnalysisFailureScreen$createView$1$1$1;'

发现了这个问题,这种问题,没有固定格式,想快速解决最好去官网issue那里看一下。

aspectjx { exclude 'com.squareup' exclude 'leakcanary' }

同样是冲突了,把冲突项目移除即可。

相关文章:

  • 2021-06-09
  • 2022-12-23
  • 2021-11-22
  • 2021-11-17
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-11
  • 2022-03-04
  • 2021-07-14
  • 2021-10-18
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案