https://gradle.com/ logo
Join Slack
Powered by
# android
  • c

    Colton Idle

    01/21/2025, 7:59 PM
    Hi all! I hit a very weird bug with android/gradle/firebase app distribution gradle plugin. I'm wondering if anyone here can help me figure out where I should file my bug report to (either gradle, or android team, or firebase app distribution team) This bug just killed like 3 days of mine due to some weird CI messages of failure where it told me my
    demo
    dimension build was built with some properties from my
    full
    dimension. Long story short. I had a build.gradle file that I migrated to build.gradle.kts and after doing so it seemed like it wasn't understanding our breakdown of demo vs full apps See: https://firebase.google.com/docs/app-distribution/android/distribute-gradle#kotlin_5
    Copy code
    productFlavors {
          create("demo") {
              dimension = "version"
              firebaseAppDistribution {
                  releaseNotes = "Release notes for demo version"
                  testers = "<mailto:demo@testers.com|demo@testers.com>"
              }
          }
          create("full") {
              dimension = "version"
              firebaseAppDistribution {
                  releaseNotes = "Release notes for full version"
                  testers = "<mailto:full@testers.com|full@testers.com>"
              }
          }
      }
    well the above... DOES NOT WORK CORRECTLY. It results in a slight bug because gradle will seemingly take the latest firebaseAppDistribution block. So even though I was generating a
    demoRelease
    build... it was getting packaged with
    full
    instead of demo. If I removed the
    create("full") {
    block then everything worked fine. Made no sense that I generated a
    demoRelease
    and it was invoking the firebaseAppDistribution block of
    full
    . I was tearing my hair out when I looked at the docs and noticed that they said to add this
    Copy code
    import com.google.firebase.appdistribution.gradle.firebaseAppDistribution
    Once I added that import then everything worked fine. πŸ˜‘ Isn't the whole point of kts is that this shouldn't compile/be type safe to not allow me to use
    firebaseAppDistribution
    block? Doing a trivial upgrade from groovy to kts seems like this bug would be happening to everyone that migrated without reading the specific setup incstructions for kts and firebase app dist gradle plugin. I'd like to be a good citizen and want to file either a bug or maybe a request for a lint rule or something to prevent this footgun from happening to someone.
    e
    x
    • 3
    • 10
  • t

    Tabalafoloh Fatogoma Ouattara

    01/24/2025, 9:53 PM
    πŸ‘‹ Bonjour Γ  tous !
    πŸ‘‹ 3
  • g

    Guillaume BΓ©ranger

    01/28/2025, 10:01 AM
    Hey guys! I know it's an old topic, but haven't found the proper solution yet. I'm trying to apply a specific plugin based on the buildTypes. I tried
    Copy code
    buildTypes{
        release {
            apply(plugin = ...)
        }
    }
    but the plugin gets applied even in debug build type. I've checked the applicationVariants, the startParamters etc but nothing seems to be working. Any idea how to achieve this ?
    m
    e
    • 3
    • 35
  • c

    Colton Idle

    01/28/2025, 9:10 PM
    Another question that I'm not exactly sure if it's gradle related... but I'll ask anyway (apologies in advance) My team is setting up github actions and we're pretty excited (finally!) One thing I noticed in the github action is
    Copy code
    -name: Android sdk
      uses: android-actions/setup-android@v3
      with:
        cmdline-tools-version: 9123335
    Do we have to specify an android sdk if we're just running gradle commands? Doesn't agp pull down the required cmdline tools?
    n
    t
    • 3
    • 8
  • s

    Shreyash Saitwal

    02/02/2025, 4:06 PM
    Stuck with this error and can't find anything that could help on the internet.
    :components:zxing
    is a
    runtimeOnly
    dependency of
    :components:runtime
    .
    Copy code
    Could not determine the dependencies of task ':components:runtime:copyDependencies'.
    > Could not resolve all dependencies for configuration ':components:runtime:releaseRuntimeClasspath'.
       > The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'. However we cannot choose between the following variants of project :components:zxing:
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-aar-metadata declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-aar-metadata' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-art-profile declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-art-profile' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-assets declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-assets' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-classes-directory-Aorg.gradle.libraryelements=classes declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-classes-directory' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
                   - Provides its elements preferably in the form of class files but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-classes-jar declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
                   - Provides its elements packaged as a jar but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-compiled-dependencies-resources declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-compiled-dependencies-resources' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-consumer-proguard-rules declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-consumer-proguard-rules' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-java-res declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-java-res' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-jni declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-jni' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-lint declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-lint' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
                   - Provides its elements packaged as a jar but the consumer didn't ask for it
           - Configuration ':components:zxing:releaseRuntimeElements' variant android-lint-local-aar declares a component for use during runtime, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.3', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
               - Unmatched attributes:
                   - Doesn't say anything about its component category (required a library)
                   - Doesn't say anything about its target Java environment (preferred optimized for Android)
                   - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
                   - Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
                   - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
           [...redacted]
    
    * Try:
    > Ambiguity errors are explained in more detail at <https://docs.gradle.org/8.12/userguide/variant_model.html#sub:variant-ambiguity>.
    > Review the variant matching algorithm at <https://docs.gradle.org/8.12/userguide/variant_attributes.html#sec:abm_algorithm>.
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    > Get more help at <https://help.gradle.org>.
    BUILD FAILED in 3s
    Configuration cache entry stored.
    e
    • 2
    • 2
  • c

    Colton Idle

    02/04/2025, 2:53 PM
    I just joined a new project and found that app modules build.gradle includes this:
    Copy code
    apply from: rootProject.file('gradle/ktlint.gradle')
    apply from: rootProject.file('gradle/publish.gradle')
    I think I read somewhere that this sort of thing is deprecated/not recommended, but of course now I can't find the conversation where that was. As a sanity check... should I be trying to migrate those files to something else?
    n
    • 2
    • 3
  • g

    Goodness Nzube

    02/05/2025, 11:58 PM
    Hello guys I encountered this error and i don't seem to handle it I need anyone that can help me, I am sorry. Thank you. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'appprocessDebugResources'.
    A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
    > Android resource linking failed aapt2 E 02-05 152230 68563 3558931 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2 E 02-05 152230 68563 3558931 ApkAssets.cpp:149] Failed to load resources table in APK '/Users/mac/Library/Android/sdk/platforms/android-35/android.jar'. error: failed to load include path /Users/mac/Library/Android/sdk/platforms/android-35/android.jar. 2 * Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    Get more help at https://help.gradle.org.
    BUILD FAILED in 11m 44s β”Œβ”€ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐ β”‚ [!] Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher. β”‚ β”‚ Please upgrade to a newer AGP version. The version of AGP that your project uses is likely β”‚ β”‚ defined in: β”‚ β”‚ /Users/mac/Desktop/example/Gja/gja/android/settings.gradle, β”‚ β”‚ in the 'plugins' closure (by the number following "com.android.application"). β”‚ β”‚ Alternatively, if your project was created with an older version of the templates, it is likely β”‚ β”‚ in the buildscript.dependencies closure of the top-level build.gradle: β”‚ β”‚ /Users/mac/Desktop/example/Gja/gja/android/build.gradle, β”‚ β”‚ as the number following "com.android.tools.buildG". β”‚ β”‚ β”‚ β”‚ Finally, if you have a strong reason to avoid upgrading AGP, you can temporarily lower the β”‚ β”‚ compileSdk version in the following file: β”‚ β”‚ /Users/mac/Desktop/example/Gja/gja/android/app/build.gradle β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Error: Gradle task assembleDebug failed with exit code 1
  • k

    KAPIL JADHAV

    02/06/2025, 7:42 AM
    Title: Help with "zip END header not found" error in React Native project Message: Hi everyone, I’m encountering an issue while building my React Native project. I get the following error during the Gradle build process:
    Copy code
    vbnet
    
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Settings file '/Users/kapil/Desktop/V4/w360-app-v4/android/settings.gradle' line: 2
    
    * What went wrong:
    Error resolving plugin [id: 'com.facebook.react.settings']
    > A problem occurred configuring project ':gradle-plugin:react-native-gradle-plugin'.
       > java.util.zip.ZipException: zip END header not found
    Details: β€’ React Native version: 0.76.3 β€’ Gradle version: 8.10.2 β€’ Operating System: macOS β€’ Plugin versions: I’m using the latest
    react-native-gradle-plugin
    . Steps I've Tried: β€’ Cleared Gradle cache (
    gradle --stop
    ,
    rm -rf ~/.gradle/caches/
    ). β€’ Cleaned the project using
    ./gradlew clean
    . β€’ Ensured that my
    settings.gradle
    and
    build.gradle
    files are correctly configured. β€’ Reinstalled dependencies via
    yarn install
    . β€’ Tried updating
    react-native-gradle-plugin
    to the latest version. My Question: Has anyone encountered this
    java.util.zip.ZipException: zip END header not found
    error before? Could this be related to a corrupted dependency, or is it more likely an issue with my Gradle setup or React Native configuration? Any suggestions on how to resolve this would be greatly appreciated! Thank you!
  • k

    KAPIL JADHAV

    02/06/2025, 8:21 AM
    Issue is resolved.
  • a

    Andrew Grosner

    02/06/2025, 11:17 PM
    has anyone been able to successfully use project isolation in an Android project yet? I am just curious if its possible and someone has got it to work, rather than Im running into any specific issue.
    πŸ‘€ 1
  • j

    Jean Tuffier

    02/13/2025, 9:25 PM
    Hei! are classpath dependencies configurations deprecated? I’m interested in using the ObjectBox database in my android project, but the github page says to configure it like this
    Copy code
    // root build.gradle
    buildscript {
        ext.objectboxVersion = "4.1.0"
        repositories {        
            mavenCentral()    
        }
        dependencies {
            classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion")
        }
    }
    // And in your app's build.gradle apply the plugin using plugins syntax:
    plugins {
        id("io.objectbox") // Add after other plugins.
    }
    I haven’t seen this type of declaration for a long time and though it was not used anymore. Is it correct to still declare it like that?
    e
    • 2
    • 3
  • p

    Peter

    02/14/2025, 10:01 AM
    anyone knows, what is the default value for
    isShrinkResources
    flag?
    e
    • 2
    • 3
  • s

    Simon Hafner

    02/18/2025, 4:01 PM
    I'm having some fun with native dependencies not being built before the main project: https://github.com/reachOS/jami-client-android/actions/runs/13394550016/job/37410158191 Even though it's explicitly specified to do so:
    Copy code
    afterEvaluate {
        val cmakeTasks = tasks.matching { it.name.startsWith("buildCMake") }
        tasks.withType<KotlinCompile>().configureEach { dependsOn(cmakeTasks) }
    }
    https://github.com/reachOS/jami-client-android/blob/master/jami-android/app/build.gradle.kts#L213
    • 1
    • 1
  • c

    Colton Idle

    02/19/2025, 5:20 PM
    Hello all. I joined a new project last week and added the spotless plugin. Running spotless seems to take forever even though its not that big of a project and we've pretty well modularized. even though we've got like 30 modules it seems to process each module one by one?
    Copy code
    > IDLE
    > IDLE
    > IDLE
    > IDLE
    > IDLE
    > :feature:myfeature <===== Each module name seems to go through here iteratively
    > IDLE
    > IDLE
    am i missing something where we could improve the speed of this? Our gradle.properties is pretty light... but could it be the culprit?
    Copy code
    android.userAndroidX=true
    org.gradle.daemon=false
    org.gradle.jvmargs=-Xmx14g -Xms4g
    org.gradle.unsafe.configuration-cache=true
    kotlin.daemon.jvmargs=-Xmx4g
    t
    • 2
    • 3
  • d

    David Rubio

    02/20/2025, 12:53 PM
    Hi everyone. We have a project with many flavors that takes a lot of memory to compile. The thing is that for compiling a single flavor in debug mode we only need about 2Gb for the Gradle daemon and another 2Gb for the Kotlin daemon. But for the
    assemble
    task we need about 5Gb for the Gradle daemon and 16Gb for the Kotlin one. Is there a way to reduce memory consumption?.
    p
    a
    • 3
    • 8
  • c

    Colton Idle

    02/23/2025, 2:14 PM
    Is it really best practice to basically make sure all plugins in a gradle project are located in root build.gradle with apply false? i.e. https://programminghard.dev/gradle-plugins-best-practices/
    πŸ‘ 1
    e
    j
    • 3
    • 11
  • m

    misha sha

    02/27/2025, 11:52 AM
    πŸ‘‹ Bonjour Γ  tous ! Je suis nouveau ici et je ne suis pas sur que je suis au bon endroit. Est-il possible de transmettre un fichier (ex. word ou pdf) qui explique clairement mon problΓ¨me . En quelque mot il s'agit d'une erreur constante lors d'un build : Invalid catalog definition: - Problem: In version catalog libs, you can only call the 'from' method a single time.
    j
    g
    • 3
    • 3
  • m

    misha sha

    02/27/2025, 11:53 AM
    Merci pour vos Γ©claircissements
  • c

    Colton Idle

    02/28/2025, 3:03 PM
    Hello! I'm trying to figure out the most convenient/best way to setup spotless in my project. In my head... you apply the spotless plugin in the root of your project. tell it you care about kt and kts files. and then you can run
    ./gradlew spotlessApply
    I've been doing some experimenting and researching and it looks like everyone does it differently. NowInAndroid (which I use as a good resource for how things should be setup) weird uses an init.gradle.kts file? gradle team repo fork: https://github.com/gradle/nowinandroid/blob/main-declarative/gradle/init.gradle.kts original android repo: https://github.com/android/nowinandroid/blob/main/gradle/init.gradle.kts Can anyone explain what's actually going on here and maybe what the best way to setup spotless is in an android project (spotless docs dont really have great info in regards to android [and it can't even pickup android src sets properly by default])
    n
    j
    x
    • 4
    • 16
  • i

    Igor Wojda

    03/03/2025, 3:48 PM
    I am trying to create custom plugin that is using
    com.android.compose.screenshot
    plugin as dependency. Idea is for my custom plugin to be located inside
    buildSrc
    (Gradle Kotlin DSL) and serve as base configuration for screenshot testing, however Gradle complains that:
    Copy code
    Please enable screenshotTest source set first to apply the screenshot test plugin.
    Add "android.experimental.enableScreenshotTest=true" to gradle.properties
    The android.experimental.enableScreenshotTest=true property is added to root build.gradle.kts file however it seems like it's not available inside buildSrc - any idea on how to fix this?
    It looks like these plugins are aplied instantly when I add
    implementation(plugin(libs.plugins.composeScreenshot))
    to
    buildSrc\settings.gradle.kts
    Perhaps I am applying these plugins in wrong way (or gradle.properties are not evaluated in time) Any ideas on how to fix this? Config: `buildSrc\settings.gradle.kts`:
    Copy code
    dependencyResolutionManagement {
      repositories {
        google()
        mavenCentral()
      }
    
      versionCatalogs {
        create("libs") {
          from(files("../gradle/libs.versions.toml"))
        }
      }
    }
    buildSrc\build.gradle.kts
    import org.gradle.kotlin.dsl.`kotlin-dsl`
    import java.util.Properties
    
    plugins {
      `kotlin-dsl`
    }
    
    repositories {
      google()
      mavenCentral()
    }
    
    dependencies {
      implementation(plugin(libs.plugins.android.application))
      implementation(plugin(libs.plugins.android.library))
      implementation(plugin(libs.plugins.compose.compiler))
      implementation(plugin(libs.plugins.composeScreenshot))
    }
    
    fun plugin(plugin: Provider<PluginDependency>) = plugin.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}" }
    `gradle\libs.versions.toml`:
    Copy code
    [plugins]
    android-application = { id = "com.android.application", version.ref = "androidPlugin" }
    android-library = { id = "com.android.library", version.ref = "androidPlugin" }
    compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
    composeScreenshot = { id = "com.android.compose.screenshot", version.ref = "screenshot" }
    x
    • 2
    • 1
  • d

    David Rubio

    03/06/2025, 8:57 AM
    Hello. The Android Gradle Plugin seems to create an aggregate test task called
    testDebugUnitTest
    in modules that don't have flavors. But it doesn't do that for modules that have flavors. We have dozens of flavors (each one is a customization for a client) that share 99% of the code, but have some little differences in code and dependencies. And we have tests specific to a flavor in
    src/testFlavor1
    ,
    src/testFlavor2
    , etc. We'd like to create a test task that runs all the tests for the current module and integrates well with the IDE (so it has to be of type
    AndroidUnitTest
    , but correct me if I'm wrong). So basically we want to create a
    testDebugUnitTest
    for these modules with flavors. How to do that?
    t
    • 2
    • 4
  • m

    Mark

    03/07/2025, 6:21 AM
    After updating to android gradle plugin 8.9.0, when I
    Generate Signed APK…
    I get:
    Copy code
    > Task :app:minifyReleaseWithR8
    AGPBI: {"kind":"error","text":"java.lang.UnsupportedOperationException: Operation is not supported for read-only collection","sources":[{}],"tool":"R8"}
    java.lang.UnsupportedOperationException: Operation is not supported for read-only collection
    If I revert back to 8.8.2, then the issue goes away.
    x
    • 2
    • 2
  • a

    Andrew Grosner

    03/12/2025, 4:57 PM
    Am I the first Android dev to try project isolation ? 😭 https://issuetracker.google.com/issues/401234700#comment7
    😭 4
  • d

    David A.

    03/20/2025, 11:41 AM
    πŸ‘‹ Hello, team! I'm having a very funny error in gradle: (this is WITH
    android.packaging.resources.excludes.add("META-INF/services/**")
    ...)
    Copy code
    Β§Β§Β§Execution failed for task ':app:mergeDebugUnitTestJavaResource'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
       > 2 files found with path 'META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler' from inputs:
          - org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1/kotlinx-coroutines-android-1.10.1.jar
          - org.jetbrains.kotlinx:kotlinx-coroutines-test-jvm:1.10.1/kotlinx-coroutines-test-jvm-1.10.1.jar
    • 1
    • 2
  • u

    Utsav Hingar

    03/26/2025, 6:33 AM
    Can you help to figure out what is the issue to build the app ? The same code of the app is working in the system of my teammates but when i am building, it is showing the build failed. [ +199 ms] Resource missing. [HTTP GET: https://dl.google.com/dl/android/maven2/ai/digitap/sync-sdk/5.1.7/sync-sdk-5.1.7.pom] [ +102 ms] Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/ai/digitap/sync-sdk/5.1.7/sync-sdk-5.1.7.pom] FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'appcheckDevDebugAarMetadata'.
    Could not resolve all files for configuration 'appdevDebugRuntimeClasspath'.
    > Could not resolve ai.digitapsync sdk5.1.7. Required by: project :app > Could not resolve ai.digitapsync sdk5.1.7. > Could not get resource 's3://digitap-sync-sdk.s3.amazonaws.com/ai/digitap/sync-sdk/5.1.7/sync-sdk-5.1.7.pom'. > The AWS Access Key Id you provided does not exist in our records. (Service: Amazon S3; Status Code: 403; Error Code: InvalidAccessKeyId; Request ID: AJMMYR6384PX0ZYM; S3 Extended Request ID: Sd5CQTCxJHmwQcxFbwN5UVzwdT7KJ4Y5IFHUtiN7EZX4pqonsqt76uTt7Yc6KRDhb7oppx7UBLjBgOHJ4eopLA==; Proxy: null) * Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    * Get more help at https://help.gradle.org BUILD FAILED in 31s Exception: Gradle task assembleDebug failed with exit code 1 Output of flutter doctor -v [βœ“] Flutter (Channel stable, 3.3.10, on macOS 15.3.2 24D81 darwin-arm, locale en-IN) β€’ Flutter version 3.3.10 on channel stable at /Users/utsavhingar/Downloads/development/flutter_3.3.10 β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision 135454af32 (2 years, 3 months ago), 2022-12-15 073655 -0800 β€’ Engine revision 3316dd8728 β€’ Dart version 2.18.6 β€’ DevTools version 2.15.0 [βœ“] Android toolchain - develop for Android devices (Android SDK version 36.0.0) β€’ Android SDK at /Users/utsavhingar/Library/Android/sdk β€’ Platform android-36, build-tools 36.0.0 β€’ Java binary at: /opt/homebrew/Cellar/openjdk@17/17.0.14/libexec/openjdk.jdk/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment Homebrew (build 17.0.14+0) β€’ All Android licenses accepted. [!] Xcode - develop for iOS and macOS (Xcode 16.2) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Build 16C5032a βœ— CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (version 2024.3) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart βœ— Unable to find bundled Java version. β€’ Try updating or re-installing Android Studio. [βœ“] VS Code (version 1.98.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.106.0 [βœ“] Connected device (3 available) β€’ sdk gphone16k arm64 (mobile) β€’ emulator-5554 β€’ android-arm64 β€’ Android 16 (API 36) (emulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 15.3.2 24D81 darwin-arm β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 134.0.6998.118 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available ! Doctor found issues in 2 categories. Output of the ./gradlew -v ------------------------------------------------------------ Gradle 7.4 ------------------------------------------------------------ Build time: 2022-02-08 095838 UTC Revision: f0d9291c04b90b59445041eaa75b2ee744162586 Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.14 (Homebrew 17.0.14+0) OS: Mac OS X 15.3.2 aarch64
    🧡 1
    e
    • 2
    • 1
  • m

    Mr Ahmed Selim

    03/29/2025, 9:57 PM
    Hello, how are you? I wish you continued health and happiness. I am working on more than one application using filters, and when building the application, a message always appears in every application that I cannot obtain the file.apk>>>* Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    * Get more help at https://help.gradle.org BUILD FAILED in 10m 4s
  • n

    Nadav Gampel

    03/31/2025, 1:24 PM
    hey all maybe u can help me. I cloned the following sample app https://github.com/google-developer-training/basic-android-kotlin-compose-training-inventory-app.git which is from the following tutorial: https://developer.android.com/codelabs/basic-android-kotlin-compose-persisting-data-room#0 im running ./gradlew build and it fails on:
    Copy code
    * Where:
    Build file '/basic-android-kotlin-compose-training-inventory-app/build.gradle.kts' line: 24
    
    * What went wrong:
    Plugin [id: 'com.android.application', version: '8.1.4', apply: false] was not found in any of the following sources:
    
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Included Builds (No included builds contain this plugin)
    - Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:8.1.4')
    what is the problem?
    c
    • 2
    • 11
  • l

    Louis Jacomet

    04/08/2025, 8:45 AM
    FYI https://gradle-community.slack.com/archives/CRA9GTYBH/p1744101917697039
    ❀️ 1
  • j

    Jay-Alexander Elliot

    04/25/2025, 1:13 AM
    Hey #CJYS1DAP5 channel! πŸ‘‹ I'm running into some persistent Gradle build failures trying to integrate the Firebase SDK (specifically the com.google.gms.google-services plugin) into an existing Android-only React Native project. I've followed the standard Firebase setup (defining the plugin in root build.gradle with apply false, applying it in app build.gradle, adding the BoM & dependencies), but the build still fails. I suspect there's a conflict or ordering issue with React Native's Gradle configuration (com.facebook.react plugin, settings.gradle setup, etc.). Here's a build scan showing the failure: https://scans.gradle.com/s/7fyfcn5vthtma Has anyone encountered similar issues or have tips for reconciling the Firebase google-services plugin setup with a typical React Native Android build configuration? Any pointers on plugin application order or potential settings.gradle interactions would be appreciated! Thanks!
  • s

    Simon Hafner

    05/06/2025, 1:09 PM
    Is there a way to make grade error out in case it doesn't find a package? Would save me a few hours of debugging.
    s
    • 2
    • 3