Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Kotlin DSL - Unresolved reference: firebaseAppDistribution

I just migrated my Andoroid project's build system from Groovy to Kotlin DSL. On migrating, I'm unable to solve firebaseAppDistribution { .. } in build.gradle.kts.

The plugin for the FAD has already been apllied and the classpath as well.

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**

How do I fix it ?

like image 818
Vivek Patel Avatar asked Sep 18 '25 13:09

Vivek Patel


1 Answers

You could use:

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

productFlavors {
    create("dev") {
        configure<AppDistributionExtension> {
            serviceCredentialsFile = "path/to/serviceAccount.json"
            releaseNotes="your release notes"
            ...
        }
    }
}
  • Step 3. Configure your distribution properties
like image 135
Mathieu Avatar answered Sep 20 '25 07:09

Mathieu