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


問題描述:

在集成百度地圖時jar包、so庫已同步到本地 在編譯項目的時候報以下錯誤:

 1 Duplicate class org.intellij.lang.annotations.Flow found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 2 Duplicate class org.intellij.lang.annotations.Identifier found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 3 Duplicate class org.intellij.lang.annotations.JdkConstants found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 4 Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 5 Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 6 Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 7 Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 8 Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
 9 Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
10 Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
11 Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
12 Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
13 Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
14 Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
15 Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
16 Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
17 Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
18 Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
19 Duplicate class org.intellij.lang.annotations.Language found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
20 Duplicate class org.intellij.lang.annotations.MagicConstant found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
21 Duplicate class org.intellij.lang.annotations.Pattern found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
22 Duplicate class org.intellij.lang.annotations.PrintFormat found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
23 Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
24 Duplicate class org.intellij.lang.annotations.RegExp found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
25 Duplicate class org.intellij.lang.annotations.Subst found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
26 Duplicate class org.jetbrains.annotations.Contract found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
27 Duplicate class org.jetbrains.annotations.Nls found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
28 Duplicate class org.jetbrains.annotations.NonNls found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
29 Duplicate class org.jetbrains.annotations.NotNull found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
30 Duplicate class org.jetbrains.annotations.Nullable found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
31 Duplicate class org.jetbrains.annotations.PropertyKey found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
32 Duplicate class org.jetbrains.annotations.TestOnly found in modules jetified-annotations-15.0.jar (org.jetbrains:annotations:15.0) and jetified-intellij_annotations.jar (intellij_annotations.jar)
33 
34 Go to the documentation to learn how to Fix dependency resolution errors.

原因分析:

當時在網上各種文檔也有所參考並沒有解決我的問題,就仔細看了一下到底是什么類重復還是jar包重復。

隨后仔細看build.gradle和libs有沒有一樣的類。

最終發現build.gradle下

 

dependencies {


    implementation 'org.jetbrains:annotations:15.0'

}

ibs文件下的

intellij_annotations.jar

可能是這兩個導致沖突


 

解決方案:

隨后就刪除了intellij_annotations.jar包在進行編譯就好了

 


寫文檔時也沒在繼續實現地圖定位邏輯直接記錄問題,遇到問題后會繼續發帖子的。

如有大牛看到此文章有什么不妥之處還請聯系博主,博主及時改進。


免責聲明!

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



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