https://gradle.com/ logo
Join Slack
Powered by
# android
  • 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
  • a

    Adrian Tache

    05/12/2025, 3:18 PM
    Hey guys, how can I configure Gradle Managed Devices to generate a release task as well?
  • v

    Vishwanth Prakash

    05/31/2025, 12:02 PM
    kindly help me with this issue...
    Copy code
    WARNING: The following problems were found when resolving the SDK location:
    101
    Where: ANDROID_SDK_ROOT environment variable. Problem: Directory does not exist
    e
    • 2
    • 5
  • v

    Vishwanth Prakash

    06/02/2025, 6:37 AM
    https://stackoverflow.com/questions/79646443/android-sdk-root-environment-variable-problem-directory-does-not-exist-react?noredirect=1#comme[…]46443 Kindly provide solution for it
  • d

    Don Phillips

    06/24/2025, 6:24 PM
    Hey everyone, wondering if anyone knows the proper incantations in a kts buildscript to properly use the Firebase App Distribution plugin, such that you can have a
    firebaseAppDistribution
    block at the project level for config common to all build variants, but also override stuff at the buildType/productFlavor level. I see that the app distribution plugin provides the following 3 extensions:
    Copy code
    package com.google.firebase.appdistribution.gradle
    
    public fun com.android.build.api.dsl.ProductFlavor.firebaseAppDistribution(action: com.google.firebase.appdistribution.gradle.AppDistributionExtension.() -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
    
    public fun org.gradle.api.Project.firebaseAppDistribution(action: com.google.firebase.appdistribution.gradle.AppDistributionExtension.() -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
    
    public fun org.gradle.nativeplatform.BuildType.firebaseAppDistribution(action: com.google.firebase.appdistribution.gradle.AppDistributionExtension.() -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
    I've got this at the top of my build script per the instructions and the linter error:
    Copy code
    import com.google.firebase.appdistribution.gradle.firebaseAppDistribution
    But only the extension on
    org.gradle.api.Project
    seems to resolve. When I add a
    firebaseAppDistribution
    block to my
    release
    buildType, I still get a red squiggly. I'm on pretty much the most recent versions of everything. So far, this is all I've found on the topic - https://medium.com/@anthony_m_cannon/android-firebase-app-distribution-for-multiple-build-types-4b50ff751ef0 and it pretty much seems like the author couldn't figure it out, so he worked around it by specifying an env-var in CI so he could pick the right one at the Project level block. But this seems wrong. But maybe the plugin is wrong? My release buildType block's type is
    org.gradle.api.NamedDomainObjectContainer<com.android.build.api.dsl.ApplicationBuildType>
    which is definitely NOT
    org.gradle.nativeplatform.BuildType
    a
    • 2
    • 3
  • a

    Ardit Qerimi

    07/10/2025, 7:49 AM
    Hi everyone, I'm having trouble running my React Native Android app using
    npm run android
    . The build fails with the following error:
    Copy code
    Execution failed for task ':app:checkDebugAarMetadata'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
    > 2 issues were found when checking AAR metadata:
        1. Dependency 'androidx.core:core:1.16.0' requires Android Gradle plugin 8.6.0 or higher.
        2. Dependency 'androidx.core:core-ktx:1.16.0' requires Android Gradle plugin 8.6.0 or higher.
    My current setup: • O*penJDK:* • 17.0.15 (2025-04-15 LTS) • Gradle: 8.3 • Android Gradle Plugin (AGP): 8.2.1 • compileSdk: 35
    n
    • 2
    • 4
  • f

    Faid Alagbe

    07/11/2025, 9:36 AM
    👋 Bonjour à tous !
  • f

    Faid Alagbe

    07/11/2025, 9:36 AM
    FAILURE: Build completed with 2 failures. 1: Task failed with an exception. ----------- * What went wrong: Execution failed for task 'appprocessReleaseResources'.
    A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
    > Android resource linking failed aapt2.exe E 07-11 112826 25748 29600 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2.exe E 07-11 112826 25748 29600 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\HP Elitebook\AppData\Local\Android\sdk\platforms\androi d-35\android.jar'. error: failed to load include path C:\Users\HP Elitebook\AppData\Local\Android\sdk\platforms\android-35\android.jar. * 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.
    ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: Execution failed for task 'appbundleReleaseResources'.
    A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
    > Android resource linking failed aapt2.exe E 07-11 112826 21836 29372 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2.exe E 07-11 112826 21836 29372 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\HP Elitebook\AppData\Local\Android\sdk\platforms\androi d-35\android.jar'. error: failed to load include path C:\Users\HP Elitebook\AppData\Local\Android\sdk\platforms\android-35\android.jar. * 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 2m 2s Running Gradle task 'assembleRelease'... 123,8s Gradle task assembleRelease failed with exit code 1
  • v

    Vareli Tecsoft

    07/16/2025, 7:48 AM
    Build file 'E:\TTP New 2.6.11\VEventManagement\build.gradle' line: 3 Plugin [id: 'com.android.application', version: '8.2', apply: false] was not found in any of the following sources: * Try:
    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.
    * Exception is: org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '8.2', apply: false] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (could not resolve plugin artifact 'com.android.applicationcom.android.application.gradle.plugin8.2')
    t
    • 2
    • 1
  • b

    Brandon Mwakasege

    07/21/2025, 1:12 PM
    hello guys, can anyone help me fix this problem Build file '\AndroidStudioProjects\MyApplication\build.gradle.kts' line: 2 Plugin [id: 'com.android.application', version: '8.11.1', apply: false] was not found in any of the following sources: * Try:
    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.
    * Exception is: org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '8.11.1', 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.applicationcom.android.application.gradle.plugin8.11.1') Searched in the following repositories: Google MavenRepo Gradle Central Plugin Repository
    e
    • 2
    • 1
  • m

    Mohammed Mahmood Ahmed

    07/27/2025, 3:54 PM
    Does anyone knows about any r8 optimization blog which digs a bit deeper into its internal. I've recently figured out that a lot of the metadata that is added by the compiler is actually shipped with the final apk but not all of it is needed. For example - kotlin intrinsics
  • a

    Andrzej Zabost

    07/30/2025, 12:10 PM
    Hi. Does anyone know why Room Gradle plugin doesn't do its job (generating DB schema file) and complains:
    Copy code
    w: [ksp] Schema export directory was not provided to the annotation processor so Room cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument by applying the Room Gradle plugin (id 'androidx.room') OR set exportSchema to false.
    depending on how the plugin is applied? --- Method 1 (everything is fine, schema is generated, no warnings)
    libs.versions.toml
    Copy code
    [versions]
    room = "2.7.2"
    
    [plugins]
    room = { id = "androidx.room", version.ref = "room" }
    app/build.gradle.kts
    Copy code
    plugins {
        // ...
        alias(libs.plugins.room)
    }
    
    android {
        room {
            schemaDirectory("$projectDir/schemas")
        }
    }
    --- Method 2 (doesn't work, "_Schema export directory was not provided ..._")
    Copy code
    [versions]
    room = "2.7.2"
    
    [libraries]
    room-plugin = { module = "androidx.room:room-gradle-plugin", version.ref = "room" }
    
    [plugins]
    room = { id = "androidx.room" } // no version here
    build.gradle.kts
    (root project)
    Copy code
    buildscript {
        repositories {
            google()
            mavenCentral()
        }
        dependencies {
            classpath(libs.room.plugin)
        }
    }
    app/build.gradle.kts
    (no changes - same as before)
    Copy code
    plugins {
        // ...
        alias(libs.plugins.room)
    }
    
    android {
        room {
            schemaDirectory("$projectDir/schemas")
        }
    }
  • a

    Andrew Grosner

    08/01/2025, 2:57 PM
    ive noticed consistently that Android studio leaks gradle daemons pretty often, nearly daily. I typically have to kill daemons or restart the IDE then kill the daemon to get rid of leaked ones. Is this a known issue? its especially egregious since we need 24GB+ of ram to build our app in reasonable amount of time. so end up with a "BUSY" daemon thats not actually compiling, then Android studio / gradle spins up a new daemon that causes memory pressure with the other one until i kill and sometimes need to restart the IDE Slack Conversation
  • a

    Asehinde Juwon

    08/08/2025, 2:09 PM
    Hi can any one help me on how to fix this error while try to #eas build my android platform?
    Copy code
    * What went wrong:
    Execution failed for task ':app:compileReleaseKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
       > Compilation error. See log for more details
    * 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 5m 47s
    Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
    e
    • 2
    • 1
  • j

    Jean Tuffier

    08/22/2025, 1:28 PM
    Hi! I’m working on a project that hasn’t get its dependencies updated for a long time. I’m trying to update protobuf from 3.25.5 to 4.32 but I’m hitting a conflict wall.
    Duplicate class com.google.protobuf.DescriptorProtos found in modules protobuf-javalite-4.32.0.jar -> protobuf-javalite-4.32.0 (com.google.protobufprotobuf javalite4.32.0) and protolite-well-known-types-18.0.1.aar -> protolite-well-known-types-18.0.1-runtime (com.google.firebaseprotolite well known types18.0.1)
    …
    I removed the direct dependency to
    javalite
    from my project, I tried what’s recommended here, I ask chatGPT and Claude for help but nothing to avail. Has anyone got those conflict issues and managed to fix them?
    e
    • 2
    • 9
  • c

    Colton Idle

    09/23/2025, 7:46 PM
    Got a popup today in android studio... didn't grab a screenshot but it said something like "New macro available for GRADLE_LOCAL_JAVA_HOME" What does that mean? is it that theres a new ENV variable for declaring which java home, gradle should use? I think im more confused at what a "macro" is maybe?
    e
    • 2
    • 1
  • s

    Said Shatila

    10/01/2025, 3:40 PM
    Hey hope all is well ! Anyone familiar with this issue
    Copy code
    java.lang.AbstractMethodError: Receiver class androidx.room.migration.bundle.FieldBundle$$serializer does not define or inherit an implementation of the resolved method 'abstract kotlinx.serialization.KSerializer[] typeParametersSerializers()' of interface kotlinx.serialization.internal.GeneratedSerializer.
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor$typeParameterDescriptors$2.invoke(PluginGeneratedSerialDescriptor.kt:40)
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor$typeParameterDescriptors$2.invoke(PluginGeneratedSerialDescriptor.kt:39)
    	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:122)
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor.getTypeParameterDescriptors$kotlinx_serialization_core(PluginGeneratedSerialDescriptor.kt:39)
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor$_hashCode$2.invoke(PluginGeneratedSerialDescriptor.kt:44)
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor$_hashCode$2.invoke(PluginGeneratedSerialDescriptor.kt:44)
    	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:122)
    	at kotlinx.serialization.internal.PluginGeneratedSerialDescriptor.get_hashCode(PluginGeneratedSerialDescriptor.kt:44)
    It happened when I added KotlinXSerialization to my Database module.
    Copy code
    plugins {
        alias(libs.plugins.yinzcam.library)
        alias(libs.plugins.yinzcam.hilt)
        alias(libs.plugins.yinzcam.room)
        alias(libs.plugins.kotlin.serialization)
    }
    
    android {
        namespace = "yinz.cam.database"
    
        buildTypes {
            release {
                isMinifyEnabled = false
                proguardFiles(
                    getDefaultProguardFile("proguard-android-optimize.txt"),
                    "<http://proguard-rules.pro|proguard-rules.pro>"
                )
            }
        }
    
        hilt {
            enableAggregatingTask = true
        }
    }
    
    dependencies {
        implementation(libs.kotlinx.serialization.lib)
    }
  • j

    Julian Molina

    10/24/2025, 2:36 PM
    Hi! New here. I'm having problem with " Could not find com.facebook.reactreact native gradle plugin.". Any ideas why?
    n
    l
    • 3
    • 2
  • m

    Maksym Moroz

    10/29/2025, 10:45 PM
    Why is
    languageSettings { }
    unavailable inside KotlinAndroidProjectExtension?
    m
    • 2
    • 4
  • c

    Colton Idle

    10/31/2025, 2:41 PM
    I'm cleaning up build files for a new project I'm on... We have this 😱
    Copy code
    android {
      compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatbility JavaVersion.VERSION_17
      }
      kotlin {
        jvmToolchain(17)
      }
      kotlinOptions {
        jvmTarget = '17'
      }
    }
    
    tasks.withType<KotlinCompile>().configureEach {
      compilerOptions { jvmTarget.set(JvmTarget.JVM_17) }
    }
    I can consolidate all of that... right? What's the "right" way?
    👆 1
    e
    m
    a
    • 4
    • 13
  • n

    nisikawa yasunori

    11/05/2025, 2:13 AM
    android studio で、作成した、プログラムに、ロックが、かかり困っています。
    👀 2
    🙇🏻 1
    🇯🇵 1
    l
    • 2
    • 2
  • n

    nisikawa yasunori

    11/06/2025, 6:48 AM
    I m having trouble because the program I created in ' Android studio ' is locked.
  • n

    nisikawa yasunori

    11/06/2025, 8:02 AM
    Error: I will show the data as follows , so please tell me the countermeasures. "Android studio Meerket(2024.3.1 Patch 2)" "java.io.FileNotFoundExceptionC\Users\.gradle\catchs\8.11.1\fileHashes\fileHashes.lock" , "C:\Users\.gradle\8.11.1\fileHashes.lock" .
    c
    a
    • 3
    • 15
  • k

    Kenny Jimno

    11/07/2025, 4:22 AM
    content://media/external/downloads/1000142287
  • e

    Emmanuel Anyebe

    11/09/2025, 10:02 AM
    #CJYS1DAP5 I'm having a Build output error when running my project on Android Studio. "Can not extract resource from com.android.aaptcompiler.ParsedResource@7b6c001."
  • n

    nisikawa yasunori

    11/10/2025, 12:17 AM
    If there are any countermeasures, Please let me know.
  • c

    Colton Idle

    11/20/2025, 2:39 PM
    Hello! I'm trying to find the easiest way to generate code coverage reports for unitTest and androidTest (Im assuming jacoco will be used, but im not necessarily tied to using jacoco. i just want code coverage reports 😅 ) It seems like jacoco is now built into AGP and so enabling it should be easy, but I'm almost confused if it is actually this easy now or what. the official docs on it are sparse (IMO) I did
    enableUnitTestCoverage = true
    in build.gradle and now I have an additional task in gradle called
    :app:createDebugUnitTestCoverageReport
    which generates an html report. this is great. At a baseline... enabling code cov (via jacoco) wasn't hard. Customizing it though does seem hard 1. Calling plugins { jacoco } is not necessary? 2. How can I remove classes/packages from being included in the coverage report? 3. I can enable
    enableAndroidTestCoverage = true
    but I dont get any gradle task generated to create those reports
    This seems to work now. idky
    t
    p
    x
    • 4
    • 6
  • c

    Colton Idle

    11/20/2025, 4:53 PM
    Is it possible to publish a library (aar) with multiple variants (i.e. debug and release)? I'm having an issue right now where im trying to publish a library and it keeps generating a BuildConfig with debug = true 😅
    t
    p
    • 3
    • 17
  • c

    Colton Idle

    11/21/2025, 6:57 PM
    Another question about aars, library publishing and 3rd party dependencies. I have an android lib/aar that I'm deploying to prod and currently we're self hosting the library. This means consumers of the lib need to add an additional maven repository declaration. This works nicely, BUT we use another 3rd party/partner which also requires an additional maven repository declaration for their android lib/aar. So basically in order to use our library you need to add two additional maven repo configs. What are my ways around this? Off the top of my head 1. somehow bundle the 3rd party aar INTO our app aar (i think i looked into this in the past and it wasn't possible?) 2. host the 3rd party dep in our maven repo (sounds like the easiest) 3. get us and the 3rd party to be on mavenCentral() (unlikely... for reasons, but technically a solution) What really throws me in a loop (sorry not a library dev) is that if I just put my library aar into a new project directly... it seems to be able to consume the aar directly without the 3rd party and it builds just fine.
    p
    t
    • 3
    • 17
  • h

    Hamed Balaira

    11/25/2025, 7:47 PM
    FAILURE: Build failed with an exception.
    🔥 3
    c
    • 2
    • 1