I solved the problem as shown below by adding a few manifestPlaceholders . Added this to my build.gradle module.
productFlavors { staging { applicationId "xxxxxxxxxxx" manifestPlaceholders = [ google_map_key:"xxxxxxxxxx", app_label_name:"xxxxxxx"] buildConfigField 'String', 'BASE_URL', '"xxxxxxxxxx"' } prod { applicationId "xxxxxxxxxxx" manifestPlaceholders = [ google_map_key:"xxxxxxxxxx", app_label_name:"xxxxxxx"] buildConfigField 'String', 'BASE_URL', '"xxxxxxxxxx"' } }
EDIT: You can use resValue as well as Emanuel Moecklin suggested in the comments.
productFlavors { staging { applicationId "xxxxxxxxxxx" manifestPlaceholders = [ google_map_key:"xxxxxxxxxx", app_label_name:"xxxxxxx"] buildConfigField 'String', 'BASE_URL', '"xxxxxxxxxx"' resValue "string", "base_url", "xxxxxxxxxx" } prod { applicationId "xxxxxxxxxxx" manifestPlaceholders = [ google_map_key:"xxxxxxxxxx", app_label_name:"xxxxxxx"] buildConfigField 'String', 'BASE_URL', '"xxxxxxxxxx"' resValue "string", "base_url", "xxxxxxxxxx" } }
source share