类型BuildConfig被多次定义 [英] Type BuildConfig is defined multiple times

查看:1023
本文介绍了类型BuildConfig被多次定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个多模块Android应用程序,并且一切都在调试模式下工作,但是现在当我尝试构建发布包时,我收到此错误:

I'm working on a multi module Android application and everything was working in a debug mode but now when I try to build a release package I'm receiving this error:

Type ***module1.BuildConfig is defined multiple times:
***/module1/build/intermediates/runtime_library_classes/release/classes.jar:***/module1/BuildConfig.class,
***/module2/build/intermediates/runtime_library_classes/release/classes.jar:***/module1/BuildConfig.class

这是我第一次看到这样的错误,而且我不知道如何解决它,甚至是什么原因.据我所知,库模块甚至不应该在发布模式下生成BuildConfig文件.

It's the first time I'm seeing an error like this and I don't know how to fix this and what's even causing it. As far as I'm aware library modules shouldn't even be generating BuildConfig files in release mode.

推荐答案

检查两个模块的软件包名称是否相同

check if both modules have a same package name

这篇关于类型BuildConfig被多次定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆