I am trying to migrate to Android Gradle Plugin 7.
I have the following code that needs migration:
applicationVariants.all { variant ->
// do some processing to obtain string apiKeyValue
variant.resValue "string", "api_key", apiKeyValue
}
I have looked at the migration blog post here android developers blog but still no clear reference to how to create dynamic
resValue
Any thoughts?
I also tried to use something similar to
androidComponents {
onVariants(selector().all(), { variant ->
// do some processing to obtain string apiKeyValue
addResValue("api_key", "string", apiKeyValue, "Value from variant")
})
}
But no luck as
addResValue
method is not found.