Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebaseAppDistribution gradle configuration overwrite problem

I want to use firebaseAppDistribution in my project and I want to customize it fo every build type.

I have three buildType debug, staging and release. Each buildtype has a different destination group inside firebaseAppDistribution.

When I run the command to distribute the app on AppDistribute I noticed that group are always missing (but the artificat is correctly uploaded)

I think that the problem is related to how gradle work. I found a post on medium (https://medium.com/@anthony_m_cannon/android-firebase-app-distribution-for-multiple-build-types-4b50ff751ef0) that has the same problem for CI. The author solved it by using an ENV variable and run firebaseAppDistribution outside the buildType scope.

How can I solve in my local environment? Can I discrimante inside build.gradle.kts which buildType is currently running?

Gradle Version 7.6

like image 478
appersiano Avatar asked Mar 03 '26 17:03

appersiano


1 Answers

Replacing firebaseAppDistribution { ... } with:

configure<AppDistributionExtension> {
  [...]
}

inside the buildType { ... } scope seemed to do the trick for me.

like image 70
omiwrench Avatar answered Mar 05 '26 07:03

omiwrench