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

同樣是沖突了,把沖突項目移除即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM