title: Setting appDistributionProperties.apkPath from Kotlin dsl
body: <p>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:</p>
  <blockquote>
  <p>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.</p>
  </blockquote>
  <p>This is what was working in groovy:</p>
  <pre><code>    applicationVariants.all { variant -&gt;
          variant.outputs.each { output -&gt;
                  tasks.findAll {
                      it.name.startsWith(
                              &quot;appDistributionUpload${variant.name.capitalize()}&quot;)
                  }.each {
                      it.doFirst {
                          it.appDistributionProperties.apkPath = output.outputFile.absolutePath
                      }
                  }
          }
      }
  </code></pre>
  <p>I can't find a way to set <code>appDistributionProperties.apkPath</code> in the kotlin dsl:</p>
  <pre class="lang-kotlin prettyprint-override"><code>applicationVariants.forEach { variant -&gt;
      variant.outputs.forEach { output -&gt;
              tasks.filter {
                  it.name.startsWith(&quot;appDistributionUpload${variant.name.capitalize()}&quot;)
              }.forEach {
                  it.doFirst {
                      it.setProperty(&quot;apkPath&quot;, output.outputFile.absolutePath)
                  }
              }
      }
  }
  </code></pre>
  <p>I'm guessing I need a magic string instead of just &quot;apkPath&quot;, because there doesn't seem to exist a strongly typed way of saying this.</p>