question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App Distribution plugin doesn't support Gradle configuration cache

See original GitHub issue

Environment

  • Android Studio version: Arctic Fox 2020.3.1 Patch 2
  • Firebase Component: App distribution
  • Component version: 2.2.0
  • Gradle version: 7.2, AGP 7.0.2

Describe the problem

When trying to run the appDistributionUploadRelease with gradle configuration cache turned on it produces an error when storing the cache because the task isn’t set up to support it.

Steps to reproduce:

Run appDistributionUploadRelease (or any other build variant) with gradle configuration cache enabled. Error pasted below:

1 problem was found storing the configuration cache.

- Task `:target:mobile:app:appDistributionUploadCurrentStageRelease` of type `com.google.firebase.appdistribution.gradle.UploadDistributionTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.

  See https://docs.gradle.org/7.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

FAILURE: Build failed with an exception.

* What went wrong:

Configuration cache state could not be cached: field 'appDistributionProperties' from type 'com.google.firebase.appdistribution.gradle.UploadDistributionTask': error writing value of type 'org.gradle.api.internal.provider.DefaultProperty'
> Configuration cache state could not be cached: field 'variant' from type 'com.google.firebase.appdistribution.gradle.AppDistributionProperties': error writing value of type 'com.android.build.gradle.internal.api.ApplicationVariantImpl'
   > Configuration cache state could not be cached: field 'unitTestVariant' from type 'com.android.build.gradle.internal.api.ApplicationVariantImpl': error writing value of type 'com.android.build.gradle.internal.api.UnitTestVariantImpl'
      > Configuration cache state could not be cached: field 'variantData' from type 'com.android.build.gradle.internal.api.UnitTestVariantImpl': error writing value of type 'com.android.build.gradle.internal.variant.TestVariantData'
         > Configuration cache state could not be cached: field 'testedVariantData' from type 'com.android.build.gradle.internal.variant.TestVariantData': error writing value of type 'com.android.build.gradle.internal.variant.ApplicationVariantData'
            > Configuration cache state could not be cached: field 'artifacts' from type 'com.android.build.gradle.internal.variant.ApplicationVariantData': error writing value of type 'com.android.build.api.artifact.impl.ArtifactsImpl'
               > Configuration cache state could not be cached: field 'storageProvider' from type 'com.android.build.api.artifact.impl.ArtifactsImpl': error writing value of type 'com.android.build.api.artifact.impl.StorageProviderImpl'
                  > Configuration cache state could not be cached: field 'directory' from type 'com.android.build.api.artifact.impl.StorageProviderImpl': error writing value of type 'com.android.build.api.artifact.impl.TypedStorageProvider'
                     > Configuration cache state could not be cached: field 'singleStorage' from type 'com.android.build.api.artifact.impl.TypedStorageProvider': error writing value of type 'java.util.LinkedHashMap'
                        > java.util.ConcurrentModificationException (no error message)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
aguatnocommented, Sep 23, 2021

I was able to see replicate the exception. Thanks @ribafish the mcve is very helpful. We’ll continue the investigation.

0reactions
eygrabercommented, Mar 2, 2022
firebaseAppDistribution {
        serviceCredentialsFile = System.getenv("APP_DISTRIBUTION_KEY")
        groups = "me"
        artifactType = "APK"
        artifactPath = "app/build/outputs/apk/release/app-release.apk"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration cache - Gradle User Manual
The configuration cache does not support all core Gradle plugins and and features. Full support is a work in progress. Your build and...
Read more >
Distribute Android apps to testers using Gradle - Firebase
gradle file, letting you configure distributions for different build types and variants of your app. This guide describes how to distribute APKs to...
Read more >
Turbocharging your Android Gradle builds using the build cache
Gradle supports both a local and a remote build cache. Each can be configured separately. When both build caches are enabled, Gradle tries...
Read more >
Failed to apply plugin [id 'com.android.application']
You need to update to the latest gradle version to solve this issue. Please make sure you are on the latest Android Studio....
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix this issue, upgrade your Android 11 emulator to version 9 or higher by navigating to Tools > SDK Manager. In the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found