ssiyy/ExcludeAar

执行任务后,aar里面要过滤的包名是没看到了,但是点击as “运行”按钮,出现:Duplicate class cn.sirius.nga.BuildConfig found in modules jetified-exclude_GDTSDK_unionNormal-runtime.jar (exclude_GDTSDK_unionNormal.aar) and jetified-XXX_sdk_v3.1.0-runtime.jar (:XXX_sdk_v3.1.0:)

jackom opened this issue · 9 comments

作者你好,我集成了你的开源库,执行任务后,aar里面要过滤的包名是没看到了,但是点击as “运行”按钮,出现:Duplicate class cn.sirius.nga.BuildConfig found in modules jetified-exclude_GDTSDK_unionNormal-runtime.jar (exclude_GDTSDK_unionNormal.aar) and jetified-XXX_sdk_v3.1.0-runtime.jar (:XXX_sdk_v3.1.0:)

image

ssiyy commented

cn.sirius.nga.BuildConfig 这各类冲突了,你把这个类也过滤一下试试

cn.sirius.nga.BuildConfig 这各类冲突了,你把这个类也过滤一下试试

image
image

过滤了也不行。

image

我在想,是不是因为 app -> libs下有我的aar文件,而 执行移除aar中某个包名后,生成的build/excludePlguin/excludeaar/exclude_GDTSDK_unionNormal.aar文件,里面跟我现在的aar文件重复了,所以导致的问题?

ssiyy commented

是这样的,你可以仿照我的demo一样在libs里面新建一个exclude文件夹,这样被过滤的aar包就不会被引用到,你再autoDependencies 等于true就会自动引用到过滤后的aar包,就不会冲突了

是这样的,你可以仿照我的demo一样在libs里面新建一个exclude文件夹,这样被过滤的aar包就不会被引用到,你再autoDependencies 等于true就会自动引用到过滤后的aar包,就不会冲突了

好的,我再试试,谢谢了~

楼主你好,我这边测试了,还是会跟之前一样的报错。。不清楚是哪里出了问题了。
image
image
image

ssiyy commented

你引用了2次

ssiyy commented

微信图片_20200918180249

你配置了autoDependencies 为true 我会自动帮你引用过滤之后的aar包,你不需要要自己再implementtation files('libs/exclude/xxxxx.aar')

好的,我再试下。

现在是可以正常运行了。谢谢楼主!