Vlad
07/15/2024, 9:11 AMapp/build.gradle.kts
val testMap = mapOf(
"test1" to "name1",
"test2" to "name2",
"test3" to "name3",
)
android {
productFlavors.all {
if (testMap.containsKey(name)) {
playConfigs.register("${name}Release") {
serviceAccountCredentials = file("$rootDir/justfolder/${testMap[name]}_manager.json")
}
}
}
}
The issue that the lambda is called at some point in time when somehow testMap doesn't have nothing inside. So if statement works, register works. Do you know why does it happen that testMap is empty?
Basically the issue that null_manager.json doesn't exist.
My fix that works:
android {
productFlavors.all {
if (testMap.containsKey(name)) {
val file = file("$rootDir/justfolder/${testMap[name]}_manager.json")
playConfigs.register("${name}Release") {
serviceAccountCredentials = file
}
}
}
}
It's android but I'd assume it's the same for all register functions, but who knows.Vampire
07/15/2024, 10:06 AMVlad
07/15/2024, 11:32 AMorg.gradle.configuration-cache=true/false
same result.Vampire
07/15/2024, 11:33 AMVlad
07/15/2024, 11:39 AMVlad
07/15/2024, 1:01 PMVampire
07/15/2024, 1:16 PMVlad
07/15/2024, 3:35 PMVampire
07/15/2024, 3:51 PMname and you will most probably see that inside you use blaRelease as you get the name from the play config while outside the register you get the name from the flavor bla.Vlad
07/15/2024, 3:59 PM