Go to the documentation to learn how to Fix dependency resolution errors. 错误

 

项目场景:

集成百度地图时遇到的重复类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包在进行编译就好了

 


写文档时也没在继续实现地图定位逻辑直接记录问题,遇到问题后会继续发帖子的。

如有大牛看到此文章有什么不妥之处还请联系博主,博主及时改进。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农夫三三

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值