集成百度地图时遇到的重复类org.intellij.lang.annotations。
问题描述:
在集成百度地图时jar包、so库已同步到本地 在编译项目的时候报以下错误:
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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'
}
libs文件下的
intellij_annotations.jar
可能是这两个导致冲突
解决方案:
随后就删除了intellij_annotations.jar包在进行编译就好了
写文档时也没在继续实现地图定位逻辑直接记录问题,遇到问题后会继续发帖子的。
如有大牛看到此文章有什么不妥之处还请联系博主,博主及时改进。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)