【问题标题】:Android Kotlin DSL - Unresolved reference: firebaseAppDistributionAndroid Kotlin DSL - 未解决的参考:firebaseAppDistribution
【发布时间】:2020-04-01 10:27:29
【问题描述】:

我刚刚将我的 Andoroid 项目的构建系统从 Groovy 迁移到 Kotlin DSL。迁移时,我无法解决 build.gradle.kts 中的 firebaseAppDistribution { .. }。

已经应用了 FAD 的插件和类路径。

plugins {
  id("com.android.application")
  //id("com.google.firebase.appdistribution") //I've tried it here but "Plugin not found"
  kotlin("android")
  kotlin("android.extensions")
  kotlin("kapt")
  id("com.google.gms.google-services")
}


apply(plugin = "com.google.firebase.appdistribution")


buildscript {
  repositories {
    google()
  }
  dependencies {
    classpath("com.google.firebase:firebase-appdistribution-gradle:1.3.1")
  }
}

。 .

 productFlavors {
    create("dev") {
     firebaseAppDistribution {
            serviceCredentialsFile = "xxx.json"
            groups = "xx"
          }
    }
 }

。 .

**Unresolved reference: firebaseAppDistribution**

我该如何解决?

【问题讨论】:

  • 我现在正在经历同样的事情。您找到有效的解决方案了吗?

标签: android firebase kotlin dsl gradle-kotlin-dsl


【解决方案1】:

你可以使用:

   import com.google.firebase.appdistribution.gradle.AppDistributionExtension

   productFlavors {
       create("dev") {
           configure<AppDistributionExtension> {
               serviceCredentialsFile = "path/to/serviceAccountKey.json"
               releaseNotes="you release note"
               ...
           }
       }
   }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-19
    • 1970-01-01
    • 2021-11-02
    • 2019-10-11
    • 1970-01-01
    相关资源
    最近更新 更多