android 关于插件包内的依赖版本不一致问题得解决

前言

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

正文

在引用一个:

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' }

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

原文地址:https://www.cnblogs.com/aoximin/p/12743670.html