I've tried converting our Android app to use the Kotlin DSL for gradle and I can't get AppDistribution to work in my CI build. This is the error I got:
App Distribution found more than 1 output file for this variant. Please contact firebase-support@google.com for help using APK splits with App Distribution.
This is what was working in groovy:
applicationVariants.all { variant ->
variant.outputs.each { output ->
tasks.findAll {
it.name.startsWith(
"appDistributionUpload${variant.name.capitalize()}")
}.each {
it.doFirst {
it.appDistributionProperties.apkPath = output.outputFile.absolutePath
}
}
}
}
I can't find a way to set appDistributionProperties.apkPath
in the kotlin dsl:
applicationVariants.forEach { variant ->
variant.outputs.forEach { output ->
tasks.filter {
it.name.startsWith("appDistributionUpload${variant.name.capitalize()}")
}.forEach {
it.doFirst {
it.setProperty("apkPath", output.outputFile.absolutePath)
}
}
}
}
I'm guessing I need a magic string instead of just "apkPath", because there doesn't seem to exist a strongly typed way of saying this.