Search code examples
androidandroid-manifestandroid-module

android manifest optional meta-data


When writing a module there is a developer-mode option switch that I want to get from the developer by the project's gradle file.

So I am geting it by manifestPlaceholders in the project's gradle:

manifestPlaceholders = [DeveloperMode : "false"]

but I want to make it optional so that when I remove it from the manifestPlaceholders the developer doesn't encounter this error:

Manifest merger failed : Attribute meta-data#developer_mode@value at AndroidManifest.xml requires a placeholder substitution but no value for is provided.

Is it possible to do so? by any other means?


Solution

  • The solution I came up with, was deleting the placeholder requirement by removing the variable from module's manifest and just read it from the manifest file of the developer's application so now if the developer needs to trigger this feature in the gradle file of the application he/she should implement the manifest placeholder functionality.