我目前正在开发一个 Android 应用程序,其中一个有多种风味维度和多种产品风味:
flavorDimensions "environment", "deviceType"
productFlavors
{
playstore
{
dimension "deviceType"
}
touchpanel
{
dimension "deviceType"
versionNameSuffix "-TouchPanel"
}
prod
{
dimension "environment"
}
integration
{
dimension "environment"
versionNameSuffix "-Integration"
applicationIdSuffix ".integration"
}
dev
{
dimension "environment"
versionNameSuffix "-Dev"
applicationIdSuffix ".dev"
}
}
我想为每个风味维度组合配置 Firebase App Distribution。
我知道如何为特定产品风格配置 Firebase App Distribution。例如:
dev
{
firebaseAppDistribution
{
serviceCredentialsFile = "${projectDir}/src/main/XXXXX.json"
artifactPath = "${buildDir}/outputs/universal_apk/devRelease/app-dev-release-universal.apk"
groups = "XXX"
}
}
但我不知道如何为变体配置 firebase:
- devPlaystore
- 集成Playstore
- prodPlaystore
- 开发触摸屏
- 集成触控面板
- 产品触控面板
事实上,我试图写这样的东西:
productFlavors
{
devPlaystore
{
firebaseAppDistribution
{
serviceCredentialsFile = "${projectDir}/src/main/XXXXX.json"
artifactPath = "${buildDir}/outputs/universal_apk/devRelease/app-dev-release-universal.apk"
groups = "XXX"
}
}
}
但是 gradle 不喜欢我的代码并在我同步 gradle 时显示以下错误:
配置项目 ':app' 时出现问题。kotlin.KotlinNullPointerException(无错误消息)
提前感谢您的帮助,以帮助我为我的案例正确配置 Firebase App Distribution :)