android
  • a

    Adrian Tache

    10/10/2022, 12:19 PM
    hello 🙂 Does anyone know if there is a why to
    include
    a module from a parent directory? The idea is to have a sample app that is in a subdirectory of the pure-Kotlin modules, but which has access to them.
  • n

    nitrog42

    10/10/2022, 3:44 PM
    Hello, I’m trying to set versioncode/versionname of an app through a custom Gradle Plugin, just like https://github.com/android/gradle-recipes/tree/agp-7.3/BuildSrc/setVersionsFromTask (but from the Kotlin code) unfortunatelly, mainOutput.versionCode.set(versionCode) throws a “The value for this property cannot be changed any further.” I remember something about not being able to do what I want because it was too late in the build chain... Does anybody have info on this ?
  • j

    Joel Sosa

    10/12/2022, 8:39 PM
    👋 Hey everyone We have an :app module that can only have certain
    :module-xxx
    modules in it I'm wondering if anyone has an idea of how to write a Gradle Task that • Verifies the
    :app
    module included projects (eg:
    implementation(project(":feature-sample"))
    ) • And if any are invalid we fail the build
  • m

    Mathew Upchurch

    10/13/2022, 6:02 PM
    Hey everyone! So I'm trying to figure out how to use the --offline option for our build server. Seems like gradle wants to always grab stuff from the web which is not exactly what we want from our build servers. I don't see much in the way of guidelines to stop gradle from doing it.. when I employ this option I get a lot of package errors. I even tried to package up in our scr (source code repository) a version of gradle and all the caches and that still seemed to not want to work. Any thoughts / ideas / docs?
  • v

    Vojtech Hrdina

    10/17/2022, 10:42 AM
    Hi, Is there any alternative for
    variant.assembleProvider.get().finalizedBy
    for
    aab
    ? I found only
    FinalizeBundleTask
    but I am not sure how to access it. (I need rename aab and repackage aab with minor modifications)
  • Colton Idle

    Colton Idle

    10/26/2022, 3:39 AM
    I've been adding custom BuildConfig fields like this
    buildConfigField("boolean", "testing", someBoolean)
    but I just stumbled upon this gradle recipes repo which defines them like this. Is my way "outdated" or is there some reason to configure it like the gradle recipe repo says? recipe repo build config
  • f

    Faraz Rasheed

    10/26/2022, 7:36 AM
    I have private repo which contains a JSON file. I want to pull that file into my android code using gradle task. I have successfully pull the file with public repo now i want to do it with private repo i have tried to provide the username and password as well
    task downloadFile(type: Download) {
        preemptiveAuth true
        username 'sldjfsdjf'
        password 'lskdjflsdfj'
        src '<https://bitbucket.org/><file>'
        dest new File(getRootDir(), '1.3.json')
        overwrite true
    
    }
    here is my gradle task Does anyone have any idea ?
  • n

    Nuh Koca

    10/26/2022, 8:32 PM
    Hello, is it possible to access
    RootProjectAccessors
    within any file in
    buildSrc
    just like version catalogs?
  • Mark

    Mark

    10/28/2022, 3:34 PM
    I know this is super-vague but I’m trying to set up jetpack macrobenchmark with a multi-module multi-dimension variant project, and am stuck with various confusing errors regarding duplicate permissions as well as probably missing fallback issues. Just wondering if there are any good samples for this, or if anyone has gone through this process of introducing macrobenchmarking/base profiling to such an Android project?
  • ansh sachdeva

    ansh sachdeva

    10/29/2022, 5:41 PM
    Hey everyone. this may sound super beginner, but i am not sure if i understand the interaction of gradle and Android project files completely. Hope someone can help I am not sure how the compilation of an android project is initiated via gradle and about the role of the following files :
    - gradlew , gradlew.bat
    - gradle/wrapper/gradle-wrapper.jar
    - gradle/wrapper/gradle-wrapper.properties
    following is my understanding. Aassuming that no command has been executed automatically by the AS, when we opened a project in AS and pressed run:1. AS instructed the OS to execute
    gradlew
    or
    gradlew.bat
    executable files 2. these files have commands which will check if the gradle version mentioned in the
    gradle-wrapper.properties
    exists on the OS (in cache or other areas accessible to AS, like PATH) , and if not will download it. 3. after downloading , the gradlew will start the
    gradle-wrapper.jar
    which will further execute the
    build.gradle
    files present in our project(and the originally downloaded gradle software, from step 2) to compile the complete app into an executable aar file a. So the relation between
    build.gradle
    files,
    gradle software
    and
    gradle-wrapper.jar
    becomes similar to that of java files, jdk and terminal : terminal is where the commands like
    javac file.java && java file
    are written & java files + jdk works together to generate an executable file that gets executed by processor and the task is doneSo is my understanding correct? if not , then what exactly is the usage of all these files and in what order do they get executed?
  • Colton Idle

    Colton Idle

    10/31/2022, 2:08 AM
    Hm. google maven down or something?
    A problem occurred configuring root project 'src'.
    > Could not resolve all files for configuration ':classpath'.
       > Could not resolve com.android.tools.build:gradle:8.0.0-alpha06.
         Required by:
             project :
          > Could not resolve com.android.tools.build:gradle:8.0.0-alpha06.
             > Could not get resource '<https://plugins.gradle.org/m2/com/android/tools/build/gradle/8.0.0-alpha06/gradle-8.0.0-alpha06.pom>'.
                > Could not GET '<https://jcenter.bintray.com/com/android/tools/build/gradle/8.0.0-alpha06/gradle-8.0.0-alpha06.pom>'.
                   > Read timed out
  • n

    Nuh Koca

    11/01/2022, 9:09 AM
    How do I configure
    CommonExtension
    in a precompiled script plugin? I am getting
    Extension of type 'CommonExtension<?, ?, ?, ?>' does not exist.
    configure<CommonExtension<*, *, *, *>> { 
        defaultConfig {
            ...
        }
    }
  • v

    Vinay Potluri

    11/02/2022, 7:23 AM
    Here is the configuration I’m using for Gradle Managed Devices app/build.gradle
    testOptions {
        managedDevices {
            devices {
                device1 (com.google.firebase.testlab.gradle.ManagedDevice) {
                    device = "Pixel2"
                    apiLevel = 30
                }
            }
        }
    }
    
    dependencies {
        implementation 'com.android.tools.build:gradle:8.0.0-alpha06'
    }
    My understanding of the Gradle Managed Devices is that it lets you run tests locally as well as remote (FTL). Does this need any other configuration if I just want to run it locally since I am seeing the below error:
    Build file '/Users/myusername/AndroidStudioProjects/TestApp/app/build.gradle' line: 37
    
    A problem occurred evaluating project ':app'.
    > Could not find method managedDevices() for arguments [build_1kapjxty3hgppqtjfx5fi2eg3$_run_closure1$_closure7$_closure9@7eaa3584] on object of type com.android.build.gradle.internal.dsl.TestOptions.
  • m

    Marek

    11/04/2022, 3:14 PM
    message has been deleted
  • v

    Vinay Potluri

    11/07/2022, 5:19 PM
    I’ve configured my project to use Gradle Managed Devices but see a lot of duplicate dependency errors. These are not the libraries / classes I added so I cannot remove any direct dependencies as suggested here https://developer.android.com/studio/build/dependencies#resolution_errors How can I resolve this ? Gradle Wrapper: gradle-8.0-milestone-3-bin.zip Plugins: com.android.application 8.0.0-alpha06 Logs: Attached
  • Arlind Hajredinaj

    Arlind Hajredinaj

    11/24/2022, 3:38 PM
    Hi, We keep seeing Gradle fail due to
    GC overhead limit exceeded
    this happens quite often in the last 1-2 months on local dev machines, when running sync project with Android Studio. We have build scans on Gradle enterprise if anyone would be able to help an identify the issue?
  • Conor Garry

    Conor Garry

    11/25/2022, 6:23 AM
    Can anyone shed any light on this strange issues I have with AGP, we’re blocked from updating from
    7.0.4
    to
    7.1.x
    because of this strange behaviour. When I update only the AGP versions, and nothing else, I get an inset at the bottom of the app. It happens at application level before any Activity starts because it affects the default splash screen. I have tried not setting any theme but it still seems to happen. Anyone got any ideas of how to go about debugging this? https://imgur.com/FQCAIf6
  • o

    Olotu Derick

    11/25/2022, 11:55 AM
    Hello Please I need help with my flutter, When I run my project I get this error
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
    > Failed to install the following SDK components:
          tools Android SDK Tools
      Install the missing components using the SDK manager in Android Studio.
  • d

    Doni

    11/28/2022, 3:28 PM
    Hi, anyone know gradle api to get executed task number? something like this below (after build completed): 451 actionable tasks: 5 executed, 446 up-to-date
  • c

    Carlos Flores

    11/28/2022, 5:08 PM
    I started looking for ways to add the android.nonTransitiveRClass property or a different mechanism to enable non-transitive r-classes for certain android modules only, and found this question with no answers. https://discuss.gradle.org/t/issue-with-non-transitive-r-class-migration/44052 Posting here to see if someone knows a path to an incremental migration to non transitive R classes.
  • j

    Jorge Dominguez

    11/30/2022, 11:36 PM
    Can I use composite builds within a single multi-module project? I'd like to conditionally perform dependency substitution to go from
    implementation project(":some_module")
    to
    implementation "com.sample:some_module"
    , but alll the samples and docs that I´ve checked use multiple standalone projects. I tried it already but I'm running into some weird Gradle issues
  • a

    Adrian Tache

    12/01/2022, 2:09 PM
    Hey, does anyone know how I could add a dependency from our internal maven, but have it be included in the app when I build it as an AAR?
  • d

    Doni

    12/02/2022, 6:03 AM
    Not sure why my incremental build up 2x after upgrading Gradle from 7.5.x to 7.6. I am using gradle profiler to benchmark it and trends recorded on gradle enterprise. It seems each task execution become slower compare to last version. anyone know if there issue related to this ?