Fabric Beta and APK splits

◇◆丶佛笑我妖孽 提交于 2019-12-03 13:18:36
Michael

For every existing variant you can add an action that will execute before Crashlytics tasks and set ext.betaDistributionApkFilePath according to the variant name. That's how it looks like:

android.applicationVariants.all { variant ->
  variant.outputs.each { output ->
    // Filter is null for universal APKs.
    def filter = output.getFilter(com.android.build.OutputFile.ABI)

    if (filter == null) {
      tasks.findAll {
        it.name.startsWith(
            "crashlyticsUploadDistribution${variant.name.capitalize()}")
      }.each {
        it.doFirst {
          ext.betaDistributionApkFilePath = output.outputFile.absolutePath
        }
      }

      tasks.findAll {
        it.name.startsWith(
            "crashlyticsUploadSymbols${variant.name.capitalize()}")
      }.each {
        it.doFirst {
          ext.betaDistributionApkFilePath = output.outputFile.absolutePath
        }
      }
    }
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!