![](/img/trans.png)
[英]unresolved reference: android build failed with kotlin dsl (reproducible in an empty project)
[英]Android Kotlin DSL - Unresolved reference: firebaseAppDistribution
我刚刚将我的 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**
我如何解决它 ?
你可以使用:
import com.google.firebase.appdistribution.gradle.AppDistributionExtension
productFlavors {
create("dev") {
configure<AppDistributionExtension> {
serviceCredentialsFile = "path/to/serviceAccountKey.json"
releaseNotes="you release note"
...
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.