我刚刚将我的 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"
...
}
}
}
关于Android Kotlin DSL - Unresolved reference : firebaseAppDistribution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60968795/