androidgradle-kotlin-dslfirebase-app-distribution

How to get Firebase App Distribution to work for different flavors with Kotlin DSL?


I have an issue with Firebase Distribution configuration. Here's a part of my build.gradle in Kotlin DSL

flavorDimensions("dim")
productFlavors {
    
    create("fl1") {
        applicationIdSuffix = ".fl1"
        setDimension("dim")
        firebaseAppDistribution {
            releaseNotes = "$name"
            groups = "group-fl1"
        }
    }

    create("fl2") {
        applicationIdSuffix = ".fl2"
        setDimension("dim")
        firebaseAppDistribution {
            releaseNotes = "$name"
            groups = "group-fl2"
        }
    }

}

Flavor 1 and flavor 2 are uploaded to 2 different Firebase projects - therefore I have two google-services.json files in: src/fl1 and src/fl2.

From observation Firebase App Distribution plugin uses always the config from second firebaseDistribution block. It looks like this is not set to flavor but globally. When I invoke for example assembleFl1Debug appDistributionUploadFl1Debug the correct .apk lands in correct Firebase project, but both release notes and groups are not correct. Anyone had a similar issue?


Solution

  • I reported this to Firebase support and just received a confirmation that it is bug, but no workaround or fix date is scheduled yet :( This concerns only build.gradle files written in Kotlin DSL.