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.
check if both modules have a same package name
My Android Manifest Had the same Package Name for two Diferent Modules.
Most probably both shared AndroidManifest.xml and androidApp AndroidManifest.xml has the same packageId. They have to be different. For example, com.my.app.shared and com.my.app.android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With