The reason is correctly indicated by Basil . Just adding a little to this, one possible reason for this may be when you have a buildType that initializes with any other buildType. For example, consider the following assembly configurations:
debug { buildConfigField 'boolean', 'ENABLE_CRASH_REPORTING', 'false' } stage { initWith(buildTypes.debug) buildConfigField 'boolean', 'ENABLE_CRASH_REPORTING', 'true' } release { buildConfigField 'boolean', 'ENABLE_CRASH_REPORTING', 'true' }
In this case, you will receive a warning for the buildType stage
Warning: BuildType (stage): value 'ENABLE_CRASH_REPORTING' buildConfigField is replaced: false -> true
The reason is pretty simple and obvious that stage inherits all fields from debugging, and then stage replaces it, because you can assign them a different value for stage (as in the case above). A possible workaround might be to replace
initWith(buildTypes.debug)
with
signingConfig signingConfigs.debug
This will fix the signature error that you usually get when assembling the build steps. But the main difference here is in the configuration now; The stage will not inherit debug assembly variables in this case, and therefore you will not receive any warning for this either. Also in this case, you will have to redefine all the assembly variables in the stage, since the (already mentioned) stage is no longer inherited from debugging.
source share