Issue
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
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.
Solution
check if both modules have a same package name
Answered By - akshay_shahane
Answer Checked By - Senaida (JavaFixing Volunteer)