ARouter踩坑之'Program type already present: com.alibaba.android.arouter.routes.ARouter$$Group$$My'

Program type already present: com.alibaba.android.arouter.routes.ARouter$$Group$$MyRouter2
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
	at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
	at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:37)
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
	... 4 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
	at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:81)
	at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
	at com.android.tools.r8.D8.run(D8.java:94)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)
	... 7 more
Caused by: com.android.tools.r8.utils.AbortException: Error: Program type already present: com.alibaba.android.arouter.routes.ARouter$$Group$$MyRouter2
	at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:101)
	at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:72)
	at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:66)
	... 10 more

原因是

@Route(path = "/MyRouter2/ARouter2Activity")
@Route(path = "/MyRouter2/ARouter3Activity")

多个module中不能使用同一个group(MyRouter2)否则会报类型重复

也即每个module中都要有各自的group,不能重复。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值